你可以用两种方法来做这件事。
将新节添加到现有节nav_menus
panel 然后将控件添加到部分:
$wp_customize->add_section(\'my_section\', array(
\'title\' => \'My options\',
\'panel\' => \'nav_menus\'
));
$wp_customize->add_setting(\'my_setting\', array(
\'type\' => \'theme_mod\',
\'settings\' => \'my_section\',
\'capability\' => \'edit_theme_options\',
\'sanitize_callback\' => \'sanitize_my_setting\'
));
$wp_customize->add_control(\'my_control\', array(
\'label\' => \'My option\',
\'section\' => \'my_section\',
\'type\' => \'text\'
));
2。向现有控件添加新控件
menu_locations
section:
<小时>
wp_customize->add_setting(\'my_setting\', array(
\'settings\' => \'menu_locations\',
\'capability\' => \'edit_theme_options\',
\'sanitize_callback\' => \'sanitize_my_setting\'
));
$wp_customize->add_control(\'my_control\', array(
\'label\' => \'My Option\',
\'section\' => \'menu_locations\',
\'type\' => \'text\'
));
如果我是你,我会选择第一个解决方案,因为它使定制程序更干净,但这取决于你的需要。我希望这会有帮助