0

I'm writing a plugin that will send a notification message to an external queue whenever a menu item is clicked. This function is related to some customized data structures I made using the Pods framework.

I'd like to add the menu item under the sub-menu for a certain Pod. The Pod is named "spotlight." Currently the only items in there are "All Spotlights" and "Add New"... I'd like to add a third item below these two.

In the code for my plugin, how do I add an additional menu item under this Pod's submenu?

1

To add submenu items to a specific Pod's menu, try this:

add_submenu_page( 'pods-manage-your_pod_name', 'My submenu item page title', 'My submenu item', 'manage_options', 'pods-manage-your_pod_name-my-submenu-item', 'your_callback_function' );

Do this during the admin_menu action in WordPress, or alternatively do it during the 'pods_admin_menu' action.

  • This worked, though I had to replace 'pods-manage-your_pod_name-my-submenu-item' with "_FILE_". That may be a consequence of the fairly ignorant design of my plugin. Also, as a note - calling this under "admin_menu" action resulted in having it as the first item under the submenu, while calling it under "pods_admin_menu" made it the last item. – Spike Williams Aug 16 '13 at 21:26
  • Actually, I ended up having to add this under "pods_admin_menu_secondary_content", because adding it under "pods_admin_menu" has the side effect of making the pods admin menu disappear entirely from the sidebar. – Spike Williams Aug 21 '13 at 18:13

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.