Answer the question
In order to leave comments, you need to log in
Where can I find proper documentation or guide on carbon fields?
For the last 4 hours ****** in order to display the fields in a separate menu in the admin panel, when I created a new container in functions, the plugin broke, although it did everything as in the documentation:
$id = Container::make( 'theme_options', 'Какое-то название' )
->add_fields( array(
Field::make('text', 'header_title', 'Заголовок')
) );
Container::make( 'theme_options', 'Другое название' )
->set_page_parent( $id )
->add_fields( array(
Field::make('text', 'another_title', 'Второй Заголовок')
) );
Answer the question
In order to leave comments, you need to log in
Carbon fields have super clear documentation
To change the location of your Theme Options page, you use set_page_parent($parent) , where $parent is either:
- Title of a top level Theme Options page.
- Identifier of a top level menu section in the admin menu sidebar. This corresponds to the $parent_slug parameter of add_submenu_page() . You can see all predefined page parents here.
__()
, _e()
, esc_html__()
and functions esc_html_e()
in English and translate the topic using loco translate or poedit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question