0

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

1
  • Please tell us what you have tried! Oct 8, 2013 at 11:05

1 Answer 1

0

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'
  );
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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