After creating a parent admin menu item, which works fine, I fail to add a submenu page. Trying to var_dump the return value of add_submenu_page() I get 'null'.
My functions are:
/**
* 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 );
}
var_dump
in your code, can you adjust it to demonstrate how you tested the return value ofadd_submenu_page
? Is there a reason you don't use the return value ofadd_menu_page
?