修复重复的领域与快速编辑自定义框钩子在Wordpress

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修复重复的领域与快速编辑自定义框钩子在Wordpress相关的知识,希望对你有一定的参考价值。

Adding custom fields to the quick edit panel in Wordpress is easy using built-in hooks. However, the hook to add fields seems to be called multiple times, adding duplicate fields to the quick edit panel. Adding this code to the top of the function being called by quick_edit_custom_box checks if the action has already been called and prevents it from being called again.

More info [here](http://wp.tutsplus.com/tutorials/extending-the-quick-edit-tool-for-taxonomy-terms/ "Extending the Quick Edit Tool for Taxonomy Terms | Wptuts+")
  1. global $post;
  2.  
  3. //if post is a custom post type and only during the first execution of the action quick_edit_custom_box
  4. if ( $post->post_type != 'post' || did_action( 'quick_edit_custom_box' ) !== 1 ) return;

以上是关于修复重复的领域与快速编辑自定义框钩子在Wordpress的主要内容,如果未能解决你的问题,请参考以下文章

用于更改编辑帖子作者框中的作者列表的 WordPress 过滤器

Flutter 项目实战 编辑框(TextField) 自定义 七

如何使用自定义钩子访问织物对象以将背景图像添加到画布?

创建永不重建的自定义钩子

修复 TypeScript 文件的快速查找

我在快速修复中找不到它(未定义减少)如何解决这个问题[重复]