-
-
Save edheltzel/3872371 to your computer and use it in GitHub Desktop.
Wordpress: Customize Admin Dashboard
This file contains 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
<?php | |
//Add a custom admin dashboard welcome widget | |
function custom_dashboard_widget() { | |
echo '<h1>Welcome to your new WordPress site built by an awesome developer</h1>'; | |
} | |
function add_custom_dashboard_widget() { | |
wp_add_dashboard_widget('custom_dashboard_widget', 'Integrity Welcomes You To WordPress!', 'custom_dashboard_widget'); | |
} | |
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget'); | |
//Set default dashboard columns to 1 | |
function so_screen_layout_columns( $columns ) { | |
$columns['dashboard'] = 1; | |
return $columns; | |
} | |
add_filter( 'screen_layout_columns', 'so_screen_layout_columns' ); | |
function so_screen_layout_dashboard() { | |
return 1; | |
} | |
add_filter( 'get_user_option_screen_layout_dashboard', 'so_screen_layout_dashboard' ); | |
//Remove unneeded admin dashboard widgets | |
function disable_default_dashboard_widgets() { | |
remove_meta_box('dashboard_right_now', 'dashboard', 'core'); | |
remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); | |
remove_meta_box('dashboard_plugins', 'dashboard', 'core'); | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); | |
remove_meta_box('dashboard_primary', 'dashboard', 'core'); | |
remove_meta_box('dashboard_secondary', 'dashboard', 'core'); | |
} | |
add_action('admin_menu', 'disable_default_dashboard_widgets'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using onetone theme .. how can I let the editor role user to use slider from onetone options and add the images he want??