panel_id
Support › MB Settings Page › panel_idResolved
- This topic has 5 replies, 2 voices, and was last updated 2 years, 5 months ago by
Peter.
-
AuthorPosts
-
November 23, 2022 at 12:04 AM #39279
Aaron Kessler
Participanthttps://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.
November 23, 2022 at 10:06 PM #39289Peter
ModeratorHello,
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.
November 23, 2022 at 10:24 PM #39293Aaron Kessler
Participanthttps://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.November 24, 2022 at 9:11 PM #39304Peter
ModeratorHello,
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/ZZdMZOjM4ArQOnpAqiDkidHoV8JIRdTest 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 100Let me know how it goes.
November 25, 2022 at 1:55 AM #39312Aaron Kessler
ParticipantThanks 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), ], ], ];
November 26, 2022 at 11:12 AM #39336Peter
ModeratorUnfortunately, it is not possible with Meta Box custom field. You can just display the fields in a separate section.
-
AuthorPosts
- You must be logged in to reply to this topic.