Category: WordPress Roles
Get Role
/*———————————————————————————–*/ /* GET role /*———————————————————————————–*/ function get_user_role() { global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); return $user_role; }
Remove Update Notification for all users except ADMIN User
ONLY show update notification for admin users (as opposed to just the user ‘admin’): // REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN global $user_login; get_currentuserinfo(); if (!current_user_can(‘update_plugins’)) { // checks to see if current user can update plugins add_action( ‘init’, create_function( ‘$a’, “remove_action( ‘init’, ‘wp_version_check’ );” ), 2 ); add_filter( ‘pre_option_update_core’, create_function( […]