0

I'm testing WordPress 5.3 (5.3-RC4-46673) with my theme. I have WP_DEBUG enabled. I notice the following error in the dashboard now:

Notice: add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.) in /app/wp-includes/functions.php on line 4903

There's a related ticket for this error here: Trac Ticket #48249

Troubleshooting The theme I'm using is a child theme.

  • Disabled all plugins, issue persists.
  • Issue happens with child them active and parent theme active.
  • Issue goes away with twentynineteen.

So it's definitely within the theme. Just not sure how to go about tracking this down.

  • If I understood correctly, the issue is there even when the active theme is the parent theme. That means the parent theme is creating a submenu page with a wrong argument, probably due to the confusion between add_menu_page and add_submenu_page. The best course of action would be to contact the author of the parent theme, so that he can patch it. – Jess_Pinkman Nov 8 at 1:21
0

I was able to track this down to the culprit function add_theme_page(). There

There was an additional parameter, per the codex for add_theme_page() that needed to be removed. Removing that seemed to help.

function fivehundred_register_admin_menu() {
    add_theme_page('500 Settings', '500 Settings', 'manage_options', 'theme-settings', 'fivehundred_admin_menu', plugins_url( '/ignitiondeck/images/ignitiondeck-menu.png'));
}

add_action('admin_menu', 'fivehundred_register_admin_menu');

Fixed code

function fivehundred_register_admin_menu() {
    add_theme_page('500 Settings', '500 Settings', 'manage_options', 'theme-settings', 'fivehundred_admin_menu');
}

add_action('admin_menu', 'fivehundred_register_admin_menu');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.