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 know this may be a bit crazy, and hopefully there's a way of doing this with out chopping up the core.

I am trying to clean up my Wordpress admin menu's and in doing such I'd like to move Comments under Posts. The problem is obouvisly edit-comments.php is a main menu item and not a sub-menu item.

I know you can make a sub_menu item a main menu item so i hoping to

Visually Speaking it'll look like this.

  • Posts
    • All Posts
    • Add New
    • Categories
    • Tags
    • Comments.

I tried this with out luck, which makes sense it doesn't work but it was an attempt...

function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Blog';
$submenu['edit.php'][5][0] = 'Manage Posts';
$submenu['edit.php'][10][0] = 'Add New Post';
$submenu['edit.php'][15][0] = 'Categories'; // Change name for categories
$submenu['edit.php'][16][0] = 'Tags'; // Change name for tags
$submenu['edit-comments.php'][25][0] = 'Comments';
$submenu['edit-comments.php'][0][0] = 'Comments';
echo '';
}
share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

Well one way to do it would be to add a new sub menu page and just remove the old one.

function wpse_80457_menu() {
add_submenu_page( 'edit.php', 'Comments', 'Comments', 'manage_options', 'edit-comments.php'); 
remove_menu_page( 'edit-comments.php' );
}

add_action('_admin_menu', 'wpse_80457_menu');
share|improve this answer
add comment

concur with @Wyck but wanted to add that you can use edit_comment since 3.1 as the capability which seems more appropriate here. Thanks for the easy solution! (not enough reputation to comment ~ sorry)

share|improve this answer
    
You can edit Wyck's answer and include what's new - and then wait for your edit to be approved. –  t f Dec 19 '13 at 19:43
    
did not realize I could do that. Thanks for helping me learn. –  andrewteg Dec 23 '13 at 15:57
add comment

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.