panel_id

Support MB Settings Page panel_idResolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #39279
    Aaron KesslerAaron Kessler
    Participant

    https://docs.metabox.io/extensions/mb-settings-page/ states

    What if you want the section to be inside another panel? Like inside another plugin's panel? Set the panel parameter to ID of the target panel: 'panel' => 'panel_id'.

    How do I get the panel ID? I am trying to add options to the core panels like site identity.

    #39289
    PeterPeter
    Moderator

    Hello,

    You can find the panel ID in the theme or plugin source code where it is registered. Please read more on the documentation https://developer.wordpress.org/themes/customize-api/customizer-objects/#panels

    I recommend contacting the theme or plugin support to ask for providing the panel ID.

    #39293
    Aaron KesslerAaron Kessler
    Participant

    https://developer.wordpress.org/themes/customize-api/customizer-objects/#panels

    According to this, the ID of "Site Title & Tagline" is title_tagline, since you change the title and tagline in the "site identity" panel, I thought this is the way to go, but 'panel' => 'title_tagline'does not work. If you don't know it, where is a good place to ask for the ids of the WordPress core panels. There are no plugins or themes involved in this case.

    #39304
    PeterPeter
    Moderator

    Hello,

    title_tagline is a section, it is not a panel. If you read the WordPress documentation carefully, you can see that a panel is a wrapper of sections, it will look like this https://monosnap.com/file/ZZdMZOjM4ArQOnpAqiDkidHoV8JIRd

    Test panel Theme Options with the theme Memory https://gretathemes.com/wordpress-themes/memory/
    and find the code register the panel in
    wp-content/themes/memory/inc/customizer/customizer.php line 100

    Let me know how it goes.

    #39312
    Aaron KesslerAaron Kessler
    Participant

    Thanks for your guidance so far. I did take a look at Memory's wp-content/themes/memory/inc/customizer/customizer.php and noticed that

    
    	$wp_customize->add_control(
    		'site_description',
    		array(
    			'label'   => esc_html__( 'Site Description', 'memory' ),
    			'section' => 'title_tagline',
    			'type'    => 'checkbox',
    		)
    	);
    

    is used to add a checkbox inside the Site Identity Panel below the 'title_tagline' inputs. So i guess i can't define this position inside the meta box custom fields definition?

    Currently, my field is defined as follows:

    
    $fields[] = [
        'title' => __('Copyright', NAME_SPACE),
        'id' => PREFIX . 'copyright',
        'panel' => '',
        'fields' => [
            [
                'name' => __('Copyright', NAME_SPACE),
                'id' => PREFIX . 'copyright',
                'type' => 'text',
                'label_description' => __('Text after copyright. Appears in the footer.', NAME_SPACE),
            ],
        ],
    ];
    
    #39336
    PeterPeter
    Moderator

    Unfortunately, it is not possible with Meta Box custom field. You can just display the fields in a separate section.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.