我的自定义帖子类型有两个子菜单项,但只有第一个子菜单项“常规设置”,在查看任何一个子菜单页时都会亮起。
add_submenu_page(
\'edit.php?post_type=landingpage\',
"General Settings",
"General Settings",
\'manage_options\',
"wp_cpt_plugin_page",
\'my_callback\'
);
add_submenu_page(
\'edit.php?post_type=landingpage\',
\'Form Settings\',
\'Form Settings\',
\'manage_options\',
\'wp_cpt_plugin_page&tab=form-settings\',
\'my_callback\'
);
如何在查看页面时点亮“表单设置”?
SO网友:Jaydip Nimavat
Check:
add_submenu_page(
\'edit.php?post_type=landingpage\',
\'Form Settings\',
\'Form Settings\',
\'manage_options\',
// This is the menu slug, you can not pass the arguments,
// if you want to pass arguments then add only one sub menu page and
// links with arguments, also display content with conditions of passed arguments.
\'wp_cpt_plugin_page-form-settings\',
\'my_callback\'
);