WordPress 小工具设置界面添加额外的内容

如果你需要在小工具设置界面添加一些提示内容,比如告诉用户主题所带的小工具的使用事项,那我们可以通过 widgets_admin_page 这个钩子来实现:

widgets-admin-wpdaxue_com

下面是一个简单的范例,将代码添加到主题的 functions.php 即可实现和上图一样的效果:

/**
 * WordPress 小工具设置界面添加额外的内容
 * https://www.wpdaxue.com/add-extra-content-to-the-widgets-admin-page.html
 */
add_action( 'widgets_admin_page', 'widgets_admin_info' );
function widgets_admin_info() {
	echo '<p style="clear:both;">添加你想要的内容哦</p>';
}

来源:

https://www.wpdaxue.com/add-extra-content-to-the-widgets-admin-page.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_32419.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?