longnguyenwp

MB settings page - style no-boxes

May 8th, 2020
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2. // Register a theme options page
  3. add_filter( 'mb_settings_pages', 'my_settings_pages' );
  4.  
  5. function my_settings_pages ( $settings_pages ) {
  6.     $settings_pages[] = array(
  7.         'id'          => 'pencil',
  8.         'option_name' => 'pencil',
  9.         'menu_title'  => 'Pencil',
  10.         'icon_url'    => 'dashicons-edit',
  11.         'style'       => 'no-boxes',
  12.         'columns'     => 1,
  13.     );
  14.     return $settings_pages;
  15. }
  16.  
  17. // Register meta boxes and fields for settings page
  18. add_filter( 'rwmb_meta_boxes', 'fields_settings_page' );
  19.  
  20. function fields_settings_page ( $meta_boxes ) {
  21.     $meta_boxes[] = array(
  22.         'id'             => 'general',
  23.         'title'          => 'General',
  24.         'settings_pages' => 'pencil',
  25.         // 'tab'            => 'general',
  26.         'fields' => array(
  27.             array(
  28.                 'name' => 'Logo1',
  29.                 'id'   => 'logo',
  30.                 'type' => 'file_input',
  31.             ),
  32.             array(
  33.                 'name'    => 'Layout',
  34.                 'id'      => 'layout',
  35.                 'type'    => 'image_select',
  36.                 'options' => array(
  37.                     'sidebar-left'  => 'https://i.imgur.com/Y2sxQ2R.png',
  38.                     'sidebar-right' => 'https://i.imgur.com/h7ONxhz.png',
  39.                     'no-sidebar'    => 'https://i.imgur.com/m7oQKvk.png',
  40.                 ),
  41.             ),
  42.         ),
  43.         'style' => 'seamless'
  44.     );
  45.     return $meta_boxes;
  46. }
Add Comment
Please, Sign In to add comment