Expert Group of programming
Loading...

Remove subsubsub menu information from WP dashboard

Posted by : Heycode Tech | Posted in : admin customization, wordpress, WordPress Functions | Sep 17,2015 | 1 comments

This article describe for removing the subsubsub i.e post listing summary.

subsub

Now if we need to remove the other information except the mine i.e The information which comes in admin .
* Mine (0)
* All (24)
* Published (19)
* Drafts (5)
* Trash (1)

I need to remove all these information except the Mine then we need to use this hooks.

/*
 *Remove the post information i.e subsubsub information. 
 */
function heycodetech_remove_sub_sub_posts_filter() {
		    
/*admin all-posts screen*/
echo '
/*#posts-filter,*/
ul.subsubsub .all,
ul.subsubsub .publish,
ul.subsubsub .sticky,
ul.subsubsub .trash,
ul.subsubsub .draft,
ul.subsubsub .pending,
.view-switch,
.tablenav ,
.row-actions .editinline,
.check-column
* {display:none;}
';
}
add_action('admin_head', 'heycodetech_remove_sub_sub_posts_filter');

Suppose you want to remove this options for some specific User role only . Then your code will look like something.Let’s take an example of the user role : contributer.

/*
 *Remove the post information i.e subsubsub information. 
 */
function heycodetech_remove_sub_sub_posts_filter() {
		    global $current_user;
    get_currentuserinfo();
     //print_r($current_user);
 if($current_user -> roles[0] == 'contributor'){
echo '

/*admin all-posts screen*/

/*#posts-filter,*/
ul.subsubsub .all,
ul.subsubsub .publish,
ul.subsubsub .sticky,
ul.subsubsub .trash,
ul.subsubsub .draft,
ul.subsubsub .pending,
.view-switch,
.tablenav ,
.row-actions .editinline,
.check-column
* {display:none;}
';
  }
}
add_action('admin_head', 'heycodetech_remove_sub_sub_posts_filter');

Now by using of this example, you can make it for other user role also . Please let me know if need any help. I ‘m available any time.

Tags:

Author information - Heycode Tech

Every world can ask question and my website registered user give the suggestion.

See all posts by Author

Connect to author
  • suseng

    Thanks for sharing! For me to work I additionally needed to put a style-tag around the style information like so: echo ‘ul.subsubsub .all, …