Skip to content

Instantly share code, notes, and snippets.

@edheltzel
Forked from arod2634/custom-wp-dashboard.php
Created October 11, 2012 13:44
Show Gist options
  • Save edheltzel/3872371 to your computer and use it in GitHub Desktop.
Save edheltzel/3872371 to your computer and use it in GitHub Desktop.
Wordpress: Customize Admin Dashboard
<?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');
?>
@Mona-Abdelkader
Copy link

Mona-Abdelkader commented Jan 22, 2017

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??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment