如何在WordPress仪表盘中添加自定义模块?

作者:30115776@qq.com

如果想在WordPress仪表盘中添加一个自定义的模块,那么如何在WordPress仪表盘中添加自定义模块?可以将下面代码添加到当前主题函数模板functions.php中:

add_action(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’wp_dashboard_setup\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’, \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’my_custom_dashboard_widgets\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’);

function my_custom_dashboard_widgets() {

global $wp_meta_boxes;

wp_add_dashboard_widget(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’custom_help_widget\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’, \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’自定义\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’, \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’custom_dashboard_help\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’);

}

function custom_dashboard_help() {

echo \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'<p>自定义内容</p>\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’;

}

发表评论