Force Dashboard Welcome For All Users
This Code Snippet Works Like a Charm!The Divi Dashboard Welcome Plugin works by replacing the default content that WordPress automatically displays in the Dashboard Welcome area with content that can be controlled using the Divi Builder. By default, WordPress displays the welcome screen to admin users only, however we can easily fix this with a simple code snippet.
Place the below code snippet into the functions.php file of your active child theme:
add_filter('user_has_cap', 'se_119694_user_has_cap');
function se_119694_user_has_cap($capabilities){
global $pagenow;
if ($pagenow == 'index.php')
$capabilities['edit_theme_options'] = 1;
return $capabilities;
}
add_action( 'load-index.php', 'show_welcome_panel' );
function show_welcome_panel() {
$user_id = get_current_user_id();
if ( 1 != get_user_meta( $user_id, 'show_welcome_panel', true ) )
update_user_meta( $user_id, 'show_welcome_panel', 1 );
}
$PrivateRole = get_role('author');
$PrivateRole -> add_cap('read_private_pages');
$PrivateRole = get_role('editor');
$PrivateRole -> add_cap('read_private_pages');
$PrivateRole = get_role('subscriber');
$PrivateRole -> add_cap('read_private_pages');