In WordPress we can remove update notifications from all users except specific roles, by username or by user ID. Below you can find a few examples that you can insert into your functions.php file.

By role

add_action('admin_head', function() { if(!current_user_can('manage_options')){ remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'maintenance_nag', 10 ); } });
Code language: JavaScript (javascript)

By username

global $user_login; get_currentuserinfo(); if ($user_login !== "joe") { // change joe to the username that gets the updates add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); }
Code language: PHP (php)

By user ID

global $user_ID; get_currentuserinfo(); if ($user_ID !== 1) { // change 1 to the id number that gets the updates add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); }
Code language: PHP (php)

Published by Dragos Micu

WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *

blogs 10c9581d how effective is 1 mg glimepiride in lowering blood sugar blogs diabetic foot ulcer wound care advanced dressing solutions for effective healing and complication 6517lower prevention movie ead5glucose understanding blood sugar levels when are they considered out of control news prevent diabetes the ultimate guide to choosing the right 05bacontrol foods a comprehensive guide to types of blood sugar monitors finding the right device for your di movie revolutionizing 8296control diabetes care the latest interventions and innovations wellness 5754 diabetes blood sugar management lower high levels with proven strategies diet for lowering blood sugar a comprehensive guide to managing blood sugar levels 84346 foods that lower high blood sugar fast a comprehensive guide 55844 do grapes spike blood sugar a comprehensive guide to managing diabetes 7031 support 8774704 injectable blood sugar therapies wellness medication based therapies for type 1 diabetes 75e7glucose management a comprehensive guide effective drinks to lower blood sugar a comprehensive guide to managing diabetes 9709 foods to reduce high blood sugar a comprehensive guide to regulating your blood glucose lev managing monk fruit blood sugar a comprehensive guide to natural sweeteners foods that help blood sugar regulation a comprehensive guide to maintaining healthy blood s wellness does whisky lower blood sugar new study reveals the truth 4df5dbe movie top milk options for blood 72c8lower sugar management a guide for diabetes patients effortless blood sugar monitoring with a finger clip home monitor for blood sugar a compreh health pregnancy associated spontaneous hypoglycemia a comprehensive b51d3 review of etiology and clinical management