How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts

After this tutorial, You know how To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts. The WP_Posts_List_Table class extends WP_List_Table and within the WP_List_Table::views() method we have the following dynamic views filter:

So we can use the generated views_edit-post filter to adjust the views of the post list table.

How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts

Let’s remove the all, publish, future, sticky, draft, pending and trash for non-admins users.

Before

before post count

After
after post count

Thanks birgire to provide the quick implementation for this problem.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.