php 从Wordpress仪表板中删除小部件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 从Wordpress仪表板中删除小部件相关的知识,希望对你有一定的参考价值。
<?php
/** REMOVE DASHBOARD WIDGETS **/
function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
remove_action( 'wp_version_check', 'wp_version_check' );
remove_action( 'admin_init', '_maybe_update_core' );
add_filter( 'pre_transient_update_core', create_function( '$a', "return null;" ) );
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
/** END REMOVE DASHBOARD WIDGETS **/
?>
以上是关于php 从Wordpress仪表板中删除小部件的主要内容,如果未能解决你的问题,请参考以下文章
php 在管理仪表板页面上删除不必要的WordPress小部件
从仪表板删除默认小部件(WordPress)
从WP-Geo-WordPress插件中删除CSSJS和/或仪表板小部件
php 在WordPress中添加全宽仪表板小部件
PHP 将小部件添加到wordpress管理仪表板
删除所有Wordpress仪表板小部件3.0+