您可以创建一个插件来更改管理仪表板。您只需创建两个函数,一个用于更改顶层工具栏,一个用于更改侧栏。然后您可以添加一些css来设置它们的样式,这将使您朝着正确的方向前进。
// If you want to change top level admin/toolbar bar
add_action( \'wp_before_admin_bar_render\', \'my_admin_bar_render\' );
function my_admin_bar_render() {
global $wp_admin_bar;
// remove all top level toolbar items
foreach ($wp_admin_bar->get_nodes() as $node) {
$wp_admin_bar->remove_node($node->id);
}
$wp_admin_bar->add_menu( array(
\'parent\' => false,
\'id\' => \'my-logo\',
\'title\' => \'<img src="http://example.com/logo.png" alt="Blavatar" class="blavatar" height="16" width="16">\',
\'href\' => "http://example.com"
));
$wp_admin_bar->add_menu( array(
\'parent\' => false,
\'id\' => \'my-toolbar-1\',
\'title\' => \'Some toolbar item\',
\'href\' => "http://example.com"
));
}
// If you want to change the side bar
add_action( \'admin_menu\', \'my_admin_menu\' );
function my_admin_menu() {
global $menu;
$menu = array(
array(
\'My menu one\',
\'\',
\'http://example.com\',
\'\',
\'my-menu-class\',
\'\',
\'div\'
)
);
}