As it is, WordPress displays by default all the pages/posts in the pages/posts list in the admin area, no matter what their publishing status is.
I have a lot of drafts, but usually I’m much more interested in editing the published pages/posts, therefore getting only to display them requires another click and full reload.
Is there a way to set WordPress to initially display only published posts/pages, allowing you to click on “All” or “Draft” if you later want to?
I’m not sure if there’s another way, but manipulating the global variable
$submenu
can make this work.The following is just a manual hack (I’m not aware of any hook) and may fail on non-standard submenus set ups. The regular Post post type has a unique address and the rest of types has another one, hence two
foreach
s.To display published pages by default on pages link, simply paste this code snippet in your functions.php. You can then visit âAllâ tab to see full list of pages.
If you want to achieve the same for post link in admin dashboard then use following code snippet instead.
Reference: http://www.wpcodesnippet.com/wordpress-admin/change-pages-link-display-published-pages/