Custom dashboard

PHP
function remove_wp_logo( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'wp-logo' ); }   /* 移除控制台左上角WP-LOGO */ 
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );


function custom_dashboard_footer () {                                                   /* 修改後台底下的wordpress文字宣告 */ 
    echo '官網維護單位 : <a href="http://abc.com/">維護單位</a>。後台如有任何問題, 請聯絡<a href="http://abc.com/">維護單位</a>'; 
} 
add_filter('admin_footer_text', 'custom_dashboard_footer');


function change_footer_admin () {return '&nbsp;';}                                      /* 隱藏後台右下角wp版本號 */ 
add_filter('admin_footer_text', 'change_footer_admin', 9999);


function change_footer_version() {return ' ';}
add_filter( 'update_footer', 'change_footer_version', 9999);

/* 強制關閉後台登入首頁的小工具 */ 
function wpc_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);        // 活動
    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_incoming_links']);   // 收到新鏈結
    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']);            // WordPress Blog
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);          // Other WordPress News
}
add_action('wp_dashboard_setup', 'wpc_dashboard_widgets');

// 後台右上角會員按鈕-改成"登出"字樣
function custom_logout_link() {
    global $wp_admin_bar;
    $wp_admin_bar->add_menu( array(
        'id'    => 'wp-custom-logout',
        'title' => '登出',
        'parent'=> 'top-secondary',
        'href'  => wp_logout_url()
    ) );
    $wp_admin_bar->remove_menu('my-account');
}
add_action( 'wp_before_admin_bar_render', 'custom_logout_link' );

//移除後台上方檢視留言按鈕
//移除後台上方"+新增"按鈕
function my_admin_bar_render() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('comments');
    $wp_admin_bar->remove_menu( 'new-content' );
    $wp_admin_bar->remove_node( 'updates' );
    $wp_admin_bar->remove_node( 'view' );
}
add_action( 'wp_before_admin_bar_render', 'my_admin_bar_render' );

Inline CSS and JavaScript

PHP
function custom_admin_res() {
  echo '<style></style><script></script>';
}
add_action('admin_footer', 'custom_admin_res');