我想在编辑帖子/页面页面的“Permalink:”下添加一些HTML。
在此下方:
那么,动作或过滤器是什么呢?
我想在编辑帖子/页面页面的“Permalink:”下添加一些HTML。
在此下方:
那么,动作或过滤器是什么呢?
您可以尝试edit_form_after_title
措施:
add_action( \'edit_form_after_title\', function(){
echo \'<hr/><div>My custom HTML</div><hr/>\';
});
要在永久链接后添加自定义HTML,请执行以下操作:它将在div#titlediv
和div#postdivrich
:
<div id="post-body-content">
<div id="titlediv">...<!-- /titlediv -->
<hr><div>My custom HTML</div><hr>
<div id="postdivrich" class="postarea edit-form-section">...</div>
...
</div>
提示:当您遇到这样的问题时,最好的办法是查看源代码。负责在admin中输出编辑后页面的文件是/wp-admin/edit-form-advanced.php
你要找的钩子是\'edit_form_after_title\'
如您所见line #476 of that file.
我正在定制Woocommerce Wordpress网站。在Woocommerce产品类别中(class-wc-product.php) 这个get_price 函数应用筛选器,如下所示:function get_price() { return apply_filters(\'woocommerce_get_price\', $this->price, $this); } 在我的功能中。php我想添加一个过滤器,如下所示:add_filter(\'woocomme