Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm writing a couple of plugins. One plugin would be the core plugin with certain bits of functionality.

The other plugin would extend that functionality.

What I've done is in the CORE plugin, I've created a menu using "add_menu_page" and I also one submenu page in that menu.

Now, as users add more extension plugins I want to add new settings menu items under the CORE plugin menu.

I tried using add_submenu_page in the extender plugin and this adds the submenu. Problem is it gets rid of the main menu sublink in the menu. The link is added to the menu, but when i click it it does not load the right page. I get a 404.

I'm curious what command should I use to add a new submenu page to an already existing admin menu?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Always happens. I ask and immediately find the answer.

The answer is in the 2nd plugin add a "priority" of 11 to the add_action command. This plugs that submenu right in there.

Like this: add_action('admin_menu', 'admin_submenu', 11);

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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