Support Forum
Support › MB Settings Page › panel_idResolved
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.
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.
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.
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.
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),
],
],
];
Unfortunately, it is not possible with Meta Box custom field. You can just display the fields in a separate section.