如果想在 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>’;
}
提醒:修改之前最好还是备份一下数据!