Plugin does not use add_submenu_page() correctly
-
Notice: Function add_submenu_page was called incorrectly. The seventh parameter passed to
add_submenu_page()
should be numeric representing menu position.
Your code in this functions is wrongpublic function add_options_page(){
global $admin_page_hooks;
$plugin_slug_name = $this->get_plugin_slug();
$plugin_title = $this->get_plugin_title();
//add_options_page
if ( empty ( $admin_page_hooks[$plugin_slug_name] ) ){
add_options_page(
__( $plugin_title, $plugin_slug_name ),
__( $plugin_title, $plugin_slug_name ),
'manage_options',
$plugin_slug_name,
array( $this, 'itc_svg_upload_option_page' ),
'dashicons-images-alt2',
);
}
}It should be
public function add_options_page(){
global $admin_page_hooks;
$plugin_slug_name = $this->get_plugin_slug();
$plugin_title = $this->get_plugin_title();
//add_options_page
if ( empty ( $admin_page_hooks[$plugin_slug_name] ) ){
add_options_page(
__( $plugin_title, $plugin_slug_name ),
__( $plugin_title, $plugin_slug_name ),
'manage_options',
$plugin_slug_name,
array( $this, 'itc_svg_upload_option_page' )
);
}
}Or
public function add_options_page(){
global $admin_page_hooks;
$plugin_slug_name = $this->get_plugin_slug();
$plugin_title = $this->get_plugin_title();
//add_options_page
if ( empty ( $admin_page_hooks[$plugin_slug_name] ) ){
add_options_page(
__( $plugin_title, $plugin_slug_name ),
__( $plugin_title, $plugin_slug_name ),
'manage_options',
$plugin_slug_name,
array( $this, 'itc_svg_upload_option_page' ),
99,
);
}
}Please adjust
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.