I need to filter my posts by Post-Formats in admin ?
How can I do that ?
For now, WordPress allows to filter by Categories and Dates.
I need to filter my posts by Post-Formats in admin ?
How can I do that ?
For now, WordPress allows to filter by Categories and Dates.
You must be logged in to post a comment.
Try this plugin i cooked up:
I was actually already working on a solution for you, just had to rewrite several parts of the code(because i based it off another plugin i wrote that does the same but for page templates on hierarchal types).
This is a little bigger than Bainternet’s plugin, so by all means stick to his solution if you’re happy with it(don’t feel obligated to switch is all i’m saying), i’m going to post it up anyway, for the sake of anyone who may be interested. It’ll work for any post type that supports post formats.
Edit/Update: Decided i might aswell put the code into a proper plugin, also did the same for adding a page template filter to hierarchal post types(that support page templates). Linked below for anyone interested,
Hope that’s helpful.. 🙂
A little bugfix, to keep the dropdown selection to the actual post format, in the function wpse26032_restrict_manage_posts_format :
Since WordPress 4.3, the function
column_title()
will include the post format as an icon next to the post title. Clicking this icon will automatically filter the current list to the selected post format.The accepted answer(s) will continue to work, and display the dropdown, however, it can be simplified as we don’t need to filter the query afterwards if we use the same query variables.
An alternative method is to display the post format as its own column. The following code will display a link which will filter the list, although I’m having issues making this column sortable, as WordPress doesn’t include any tax queries when all formats are being shown.
Both the short version of the format, as provided by
get_post_format()
, and the long version output bywp_dropdown_categories()
, appear to work in the same fashion when filtering posts.EDIT:
get_post_format
will return false if there is an error or no format is selected. In this case it should be safe to assume ‘standard’ as the selected format. I’ve included a fallback to ‘standard’ whenget_post_format()
returns false.