Remove dashboard widget API

Cập nhật lần cuối 16/03/2017 by trong WordPress vào 13/10/2013 có 999 Views
Remove dashboard widget API

Remove dashboard widget API


Code sau đây sẽ giúp các bạn có thể remove dashboard widget ….

function mw_remove_dashboard_widgets()
{
// Globalize the metaboxes array, this holds all the widgets for wp-admin
global $wp_meta_boxes;
// Main column:
unset($wp_meta_boxes['dashboard']['normal']['high']['dashboard_browser_nag']);
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']);
// Side Column:
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']);
}
add_action('wp_dashboard_setup', 'mw_remove_dashboard_widgets' );

ok. Khi đã remove thành công thì chắc bạn cần Thêm dashboard widgets

Chúc các bạn thành công!

5/5 - (2 votes)
  • Bình luận
Sản phẩm nổi bật của Toản
x