Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to add 2 lines to the POSTS menu in the wordpress admin: Published and Scheduled. I would also like to add a section to the media menu for Unattached media. How would I go about doing this?

Cheersenter image description here

share|improve this question
    
Please tell us what you have tried! –  Pothi Oct 8 '13 at 11:05

1 Answer 1

up vote 0 down vote accepted

You can intercept the global $submenu var and add the desired elements:

add_action('admin_menu', 'add_custom_submenus', 999);

function add_custom_submenus() {
  global $submenu;
  $submenu['edit.php'][] = array(
    __('Published'), // menu title
    'edit_posts', // menu cap
    'edit.php?post_status=publish&post_type=post' // menu link
  );
  $submenu['edit.php'][] = array(
    __('Scheduled'),
    'edit_posts',
    'edit.php?post_status=future&post_type=post'
  );
  $submenu['upload.php'][] = array(
    __('Unattached'),
    'upload_files',
    'upload.php?detached=1'
  );
}
share|improve this answer
    
That fixed it, Thanks G.M. –  user39156 Oct 8 '13 at 16:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.