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 *

understanding the benefits of super health cbd gummies pure cbd isolate for enhanced wellness experience the perfect blend unleash the power of wyld cbd hybrid gummies for optimal relaxation an understanding the benefits of reviv cbd gummies 300 mg for overall well being find relief with cbd gummies for nerve pain a natural and effective solution katie couric cbd gummies a comprehensive guide to the benefits and effects of cbd on alzheimer 39 s di hemp bombs sleep gummies review a comprehensive analysis of efficacy and benefits 3269 cbd gummies for tendonitis natural relief and treatment options karma cbd gummies the ultimate relaxation solution for a blissful life unlock the power of keto gummies a comprehensive guide to the ingredients of keto gummies that will keto gmy bhb gummies price the ultimate solution for sustainable weight loss erectile dysfunction otc a comprehensive guide to over the counter treatments 69402 revitalize your love life with vitality cbd gummies for ed a natural and effective solution the science behind biopic male enhancement a comprehensive guide to male enhancement soluti the best erectile dysfunction pill a comprehensive guide to effective treatment 40514 vitafusion men 39 s gummy vitamins reddit a comprehensive review of the product 39 s effectiveness and us airy cbd gummies a natural approach to enhanced male vitality cbd gummies for erectile dysfunction reviews a comprehensive guide to effective treatment peak 8 cbd gummies for ed unlock a healthier happier you with natural relief 30901 a proper cbd gummies review uncovering the truth behind shark tank cbd gummies for erectile dysfunc cbd gummies and sex unlocking a deeper connection with nature 39 s bliss