修复重复的领域与快速编辑自定义框钩子在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+")
global $post; //if post is a custom post type and only during the first execution of the action quick_edit_custom_box if ( $post->post_type != 'post' || did_action( 'quick_edit_custom_box' ) !== 1 ) return;
以上是关于修复重复的领域与快速编辑自定义框钩子在Wordpress的主要内容,如果未能解决你的问题,请参考以下文章
用于更改编辑帖子作者框中的作者列表的 WordPress 过滤器