WordPress tweak to manage posts admin, filter and show custom field
Published:
| by Julian Knight Reading time ~1 min.
📖 Posts
| 📎
Blogging, Development
| 🔖
HTML, PHP, Wordpress
This tweak will change the “All Posts” page in the administration section of a WordPress site.
It adds the ability to filter the post list based on a custom field that has been used in any of the posts at any time.
If a custom field is selected but no filter value is given, all posts that contain any value in the custom field are listed.
Whether or not a value is provided, if a custom field is selected, that field will be added to the tabular view of posts. The custom field column is also made sortable (as is the Category column).
The following code should be added to the functions.php
for your theme – or better still to a sub-theme.