plugins - There is any way to remove post-format filter?

Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 5 years ago.

Improve this question

I have tried to remove_theme_support( 'post-formats') set higher priority but it is not working

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 5 years ago.

Improve this question

I have tried to remove_theme_support( 'post-formats') set higher priority but it is not working

Share Improve this question edited Feb 13, 2020 at 7:45 Anupam Tiwari asked Feb 13, 2020 at 6:49 Anupam TiwariAnupam Tiwari 111 bronze badge 1
  • still working on remove_theme_support( 'post-formats'); remove_post_type_support( 'post', 'post-formats' ).........Its not wolrking – Anupam Tiwari Commented Feb 13, 2020 at 9:24
Add a comment  | 

1 Answer 1

Reset to default 0

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744706202a4589070.html

相关推荐

  • plugins - There is any way to remove post-format filter?

    Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add

    12天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信