Adding a sub-menu in the wordpress admin menu :)

2010-07-29 263 words 2 mins read

For the impatient ones, first the code:
(in wp-admin folder, open the file menu.php) and locate the code:

$submenu[’edit.php’][10]ย  = array( _x(’Add New’, ’post’), ’edit_posts’, ’post-new.php’ );

and add the below:

$submenu[’edit.php’][7]ย  = array( _x(’Pending’, ’post’), ’edit_posts’, ’edit.php?post_status=pending&post_type=post’ );

And now the explanation and why do you need this ๐Ÿ™‚

Problem:

There is no direct mechanism to access the pending posts in WP admin. I generally post through email and mark them as pending. So, whenever I go to my admin POSTs page, I will look through the list of pending items and post them as and when required. For this, when I am done with changes in one item, I need to either modify the address bar or need to go to posts link and then click the Pending items.

I kind of did not like this so added one submenu just below the add new.. Cool, this is my first hack of the WP-core to get something going. For Plugins and sidebar I have kept doing this anywasys ๐Ÿ™‚<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.twm-kd.com/computers/software/using-menus-in-wordpress-3-0/">Using menus in WordPress 3.0 (twm-kd.com) <li class="zemanta-article-ul-li"><a href="http://pressography.com/wordpress/12-new-multisite-tools-for-network-management-in-wordpress-3-0/">12 New Multisite Tools for Network Management in WordPress 3.0 (pressography.com) <li class="zemanta-article-ul-li"><a href="http://wpmu.org/12-new-multisite-tools-for-network-management-in-wordpress-3-0/">12 New Multisite Tools for Network Management in WordPress 3.0 (wpmu.org) <li class="zemanta-article-ul-li"><a href="http://www.makeuseof.com/tag/create-registration-form-types-forms-wordpress-cformsii/">How To Create A Registration Form (and other forms) In WordPress Using cformsII (makeuseof.com) <li class="zemanta-article-ul-li"><a href="http://thinkvitamin.com/dev/getting-started-with-wordpress-custom-menus/">Getting Started with WordPress Custom Menus (thinkvitamin.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e8.png" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. Weโ€™re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it