TL;DR: This article outlines the code needed to add a custom link on the All Posts screen that uses a custom piece of post metadata.
Note: A few months ago, I wrote an article on how to add a custom view to the All Posts screen. This article is not all together the same, but not all together different. Think of it as a more detailed and perhaps for more practical implementation of the concept.
Assume that you have a standard post type or a custom post type and you’re going to simply filter by a headline that you define using a mechanism that allows you to save data to the post_metadata
table.
For example, let’s say that you have a post and it as a piece of meta data with:
- a
meta_key
with the value ofarticle_attribute
- a
meta_value
with the value ofheadline
And you want to use this information to add a new Headlines link that automatically filters everything out except articles with that metadata.
Here’s how to do it.
Continue reading