Custom Fields
Re-Envisioned
Support MB Settings Page Customizer Settings in Plugin

  • This topic is empty.
  • Creator
    Topic
  • #17200
    Creative
    Participant

    I’ve added 'customizer' => true, to my setting page to get my fields into the customizer, but am not seeing it display. I’ve added my code for the settings page to a plugin. Does it work with plugins? I’m able to see the settings page but not in the customizer.

    Here is my code

    
    // Register settings page. In this case, it's a theme options page
    add_filter( 'mb_settings_pages', function ( $settings_pages ) {
        $settings_pages[] = array(
            'id'          => 'rubik',
            'option_name' => 'theme_mods_justread',
            'menu_title'  => 'Theme Options',
            'parent'      => 'themes.php',
    
        'customizer'  => true,
        );
        return $settings_pages;
    } );
    
    // Register meta boxes and fields for settings page
    add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
        $meta_boxes[] = array(
            'id'             => 'general',
            'title'          => 'General',
            'settings_pages' => 'rubik',
            'fields'         => array(
                array(
                    'name' => 'Logo',
                    'id'   => 'logo',
                    'type' => 'file_input',
                ),
                array(
                    'name'    => 'Layout',
                    'id'      => 'layout',
                    'type'    => 'image_select',
                    'options' => array(
                        'sidebar-left'  => 'http://i.imgur.com/Y2sxQ2R.png',
                        'sidebar-right' => 'http://i.imgur.com/h7ONxhz.png',
                        'no-sidebar'    => 'http://i.imgur.com/m7oQKvk.png',
                    ),
                ),
            ),
        );
        $meta_boxes[] = array(
            'id'             => 'custom-colors',
            'title'          => 'Custom Colors',
            'settings_pages' => 'rubik',
            'fields'         => array(
                array(
                    'name' => 'Heading Text Color',
                    'id'   => 'heading-color',
                    'type' => 'color',
                ),
                array(
                    'name' => 'Text Text Color',
                    'id'   => 'text-color',
                    'type' => 'color',
                ),
            ),
        );
    
        return $meta_boxes;
    } );
    
  • You must be logged in to reply to this topic.