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 *

effective exercise for erectile dysfunction a comprehensive guide to improving your health earth essence cbd gummies for ed a natural and effective solution for achieving peak performance foods that boost libido in males a comprehensive guide 9045 315 enhancing intimacy with libido boosting supplements for females a comprehensive guide 72905 cbd gummies vs tincture which is the better choice for your wellness journey elevate your well being with elevate well cbd gummies 803 experience the power of cbd gummies free shipping unlock a healthier you naturally discover the power of cheef cbd gummies a game changer for your mind and body experience the bliss of cbd gummies columbia sc unlocking the power of nature 39 s relaxation do hemp gummies work a comprehensive analysis of their effectiveness tramadol and cbd gummies a revolutionary combination for pain relief and wellness do gummy bears expire shelf life safety and expiration date explained revolutionize your weight loss journey with dr jennifer ashton 39 s weight loss gummies a comprehensi transform your life with transform keto apple cider vinegar gummies reviews unlocking the power of discover the no sugar keto gummies tiktok sensation a delicious and effective way to achieve your w unlock the power of cbd thc gummies for weight loss a comprehensive guide to achieving your goals does walgreens carry keto gummies a comprehensive guide to buying the best keto gummies online reveal the power of let 39 s keto bhb gummies unlock optimal weight loss and wellness the ultimate guide to naltrexone for weight loss benefits and strategies in 2024 embracing the slim life trinity brands keto gummies revolutionizing weight loss with science backed