刪除Wordpress面板中默認(rèn)的Widget部件

2012-05-06 20:42:45來源:stackexchange作者:

 

 

從面板中刪除默認(rèn)的Widget部件的代碼(刪除Wordpress面板中默認(rèn)的Widget部件):

// Create the function to use in the action hook
function example_remove_dashboard_widgets() {
    // Globalize the metaboxes array, this holds all the widgets for wp-admin

    global $wp_meta_boxes;

    // Remove the incomming links widget
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);  

    // Remove right now
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );

關(guān)鍵詞:WordpressWidget

贊助商鏈接: