forked from hugoassuncao/wordpress_snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove-dashboard-widgets.sublime-snippet
27 lines (22 loc) · 1.17 KB
/
remove-dashboard-widgets.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<snippet>
<content><![CDATA[
/// remove unused dashboard widgets
function remove_dashboard_widgets() {
global \$wp_meta_boxes;
unset(\$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
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_right_now']);
unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>dashwidgetout</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- Optional: Description to show in the menu -->
<description>Remove the dashboard widgets </description>
</snippet>