Created
February 10, 2015 04:52
-
-
Save designbuildtest/504cf2dac7b7dbe88809 to your computer and use it in GitHub Desktop.
Remove all Dashboard Widgets and make Dashboard a single colum display.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function myplugin_admin_custom_ui() { | |
| if ( is_admin() ) { | |
| // Remove All Dashboard Widgets. | |
| remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); | |
| remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); | |
| remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); | |
| remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); | |
| remove_meta_box( 'rg_forms_dashboard', 'dashboard', 'core' ); // Remove Gravity Forms Dashboard Widget | |
| // Condense Dashboard to a single column. | |
| function myplugin_single_screen_columns( $columns ) { | |
| $columns['dashboard'] = 1; | |
| return $columns; | |
| } | |
| add_filter( 'screen_layout_columns', 'myplugin_single_screen_columns' ); | |
| function myplugin_single_screen_dashboard() { | |
| return 1; | |
| } | |
| add_filter( 'get_user_option_screen_layout_dashboard', 'myplugin_single_screen_dashboard' ); | |
| } | |
| } | |
| add_action( 'admin_init', 'myplugin_admin_custom_ui' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment