I'm using the add_submenu_page function of wp to add a sub menu inside a parent men, but I'm getting this error when accessing that submenu:
Sorry, you are not allowed to access this page.
I'm logged in as admin, flushed permalinks and logged out then logged in but nothing is changing.
my code:
class SPSetup {
public function reg_func() {
add_action( 'admin_menu', array( $this, 'sp_menu', ) );
}
public function sp_menu() {
add_submenu_page(
'montheme_options', 'SP Dashboard', 'SP Dashboard',
'manage_options', 'sp-control',
array( $this, 'callback' )
);
}
}
if ( class_exists( 'SPSetup ' ) ) {
$SP= new SPSetup ();
$SP->reg_func();
}