创建了一个工作正常的父管理菜单项后,我无法添加子菜单页。尝试var\\u dump add\\u submenu\\u page()的返回值时,我得到“null”。
我的职能是:
/**
* Register the admin menu page
*
* @since 1.0.0
*/
public function add_admin_menu() {
add_menu_page( \'WPQuotes\', \'WPQuotes\', \'manage_options\', \'wp-quotes-plugin\', \'wpq_admin_settings_page_main\', \'dashicons-networking\' );
add_submenu_page( \'wp-quotes-plugin\', \'New WPQ Form\', \'New WPQ Form\', \'manage-options\', \'wpq-new-form\', \'wpq_admin_settings_page_new_form\');
}
public function run_all(){
add_action( \'admin_menu\', array($this, \'add_admin_menu\'), 10 );
}