There is any way to remove post-format filter?
Topic post-formats theme-options multisite plugins themes Wordpress
Category Web
Topic post-formats theme-options multisite plugins themes Wordpress
Category Web
The filter will be displayed by default if any posts of the current type already have a post format associated with them, regardless of whether the theme supports post formats or not.
We can see from your screenshot that posts already have post formats, so the filter is displayed.
Here's the code that will allow you to disable the Post Formats filter:
/**
* Filters whether to remove the 'Formats' drop-down from the post list table.
*
* @param bool $disable Whether to disable the drop-down. Default false.
*/
add_filter( 'disable_formats_dropdown', '__return_true', 10, 1 );
One good way of finding filters like this is to inspect the HTML of the rendered page, then search the WP source for HTML class name (or other markup) related to the feature your're trying to change.
For example, I searched for filter-by-format
found the disable_formats_dropdown
filter in formats_dropdown()
in wp-admin/includes/class-wp-posts-list-table.php
.
Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.