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

  • Please tell us what you have tried! – Pothi Kalimuthu Oct 8 '13 at 11:05
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'
  );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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