WordPress 3.5 新增了一对非常有用的挂钩,可以快速在WordPress后台文章编辑器的上方或下方添加提示内容,下面是一个简单的例子,直接将代码添加到主题的 functions.php 文件:
function below_the_title() {
echo '<h3>在编辑器上方添加的提示内容</h3>';
}
add_action( 'edit_form_after_title', 'below_the_title' );
function below_the_editor() {
echo '<h4>在编辑器下方添加的提示内容</h4>';
}
add_action( 'edit_form_after_editor', 'below_the_editor' ); |
function below_the_title() {
echo '<h3>在编辑器上方添加的提示内容</h3>';
}
add_action( 'edit_form_after_title', 'below_the_title' );
function below_the_editor() {
echo '<h4>在编辑器下方添加的提示内容</h4>';
}
add_action( 'edit_form_after_editor', 'below_the_editor' );
结果如下图所示:

参考资料:http://www.doitwithwp.com/add-a-message-above-or-below-the-post-editor/
来源:
https://www.wpdaxue.com/add-a-message-above-or-below-the-post-editor.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32470.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57