I’m using a plugin called CMS Page Order http://wordpress.org/extend/plugins/cms-page-order/ (Now referred to as CPO)
It’s pretty simple, the said plugin adds a new item to the submenu of every custom post type. The menu item leads to a page where you can reorder the posts of the certain post type.
I’ve added so that you can create new posts directly from this view, so basically it’s like the default edit post view in WordPress, but you can reorder your posts aswell. This renders the usual post edit page pretty useless.
So my question is, is there a way for me to remove the “All post type‘s” submenu item (edit.php?post_type=nameofposttype
) replacing it with this menu item created by CPO while also making the top level menu item itself point to the page created by CPO.
âââ
What I’ve been trying to do is to try to replace the top level menu item with the URL of the submenu item created by CPO using the plugin Admin Menu Editor, but changing the URL via the plugin is not allowed it seems. I then tried moving the CPO menu item to the top of the submenu as I noticed that the top level menu item points to the topmost submenu item (ie “All pages/posts”). That did not work either, as it produces an URL that is erroneous (it makes the top level menu item point to admin.php?page=order-xxx
)
Here’s some images to further explain what I mean.
Here’s how the top level item behaves as default (edit.php?post_type=xxx
)
Now here’s what happens if I move my page with the special menu handler to the top. The top level item gets a new URL, but it’s erroneous (admin.php?page=order-xxx
)
Here’s the URL that the special menu handler page has, the URL that the top level menu item should have (edit.php?post_type=xxx&page=order-xxx
)
So, how can I change the top level menu item to the URL I want?
You can also change the menu with the global variables of WordPress for display the menu and submenu.
All first items are in the var
$menu
and all suparts are in$submenu
.Also a small example for change the order of the submenu-items with
edit.php
.Add thius plugin and see the result via debugging. The function
fb_cmp
is only the logic for reorder, but you can define you custom order in this function, she is the callback forusort
.As hint the result in a screenshot.
have you tried considering jquery? Maybe this will help you. Ive tried it and it worked. Just put this in your functions.php
Afaik, you can simply use
add_query_arg( 'key', 'value' );
when registering the page.I explained the details of the WordPress admin menu system in this blog article. Can’t post this hear as it’s much too much and mucho too much.