I hope there is an easy answer for this, as it doesn't seem like it should be difficult and could make my backend much easier for other's to use.

I'm trying to add links to custom post types - that is, a shortcut in the sidebar, not a typical wordpress link that you would put in the link category.

Let's say my sidebar looks like:

Stores (custom post-type)
- All Stores
- Add Store
- My custom link

The last line would be the custom link. Hopefully it is possible to make this link appear as a child to a custom post type, but if not at least having a static link would be a good start.

The closest I could find on Google was this page about adding separators to the admin panel, which is useful for indicating my custom post types. Unfortunately the code for this is very alien to me (and the comments are only present on the obvious code, which is very frustrating).

I assume that the code used for the separator is at least close to what I need, though. At the very least, where should I even look for an answer?


This should do it.

function register_additional_page(){
    add_submenu_page('edit.php?post_type=tree', 'Bulk Process', 'Bulk Process', 'activate_plugins', 'tree_bulk_process', 'render_bulk_tree_process');
add_action('admin_menu', 'register_additional_page');

And the function that renders the page.

function render_voucher_list_page(){
        <h2>Hello World</h2>

Change post_type=tree to your Custom Post Type, Bulk Process to the menu title, activate_plugins to your desired user capability, tree_bulk_process to your page 'slug' and render_bulk_tree_process to your custom function that renders the page.

Hope this help

  • Oh man, how could I not have found this? Works like a charm. Is there a way to instead of making this render a custom page, make it link to an existing URL (internal or external)? Especially for if I have a menu that says "Manage Links" but I want to use built-in link category, I'd want to link the menu to /wp-admin/link-manager.php?cat_id=23, which would show links within a specified category. – Radley Sustaire Sep 3 '12 at 2:16
  • Haven't tried to make it an internal link to link manager. I'll check it later on. – ifdion Sep 3 '12 at 2:18
  • I'll just go with a javascript redirect for now, the plus side being the page can display a "You are leaving Wordpress..." or something similar. I didn't see anything in the codex about it, but I'm satisfied with JS redirect. – Radley Sustaire Sep 3 '12 at 2:45

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.