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">
Related Articles:
- 2010/06/06 colors in bash – script to display all the possible colors.
- 2010/05/27 Checking the links to your site (from affiliates) using cron and bash script.
- 2010/05/26 10 Wordpress Traffic Builder Plugins That Work
- 2010/05/24 Inotify Example - Introduction to Inotify with a C Program Example
- 2010/05/19 vim โ get names of the scripts and the details from the command line