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 *

ruleta en vivo casino boomerang casino codigo promocional y bonus code bingo eireann casino resena starplayup casino resena casino online magic la experiencia de juego que debes probar en argentina e6cba82d64f0 slot online gratis ulisse 54552 mx bwin bono casino codigo promocional mejores bonos de bienvenida casino club serrano reseas jqk bet casino resena bally hot shot tragaperras online finn s golden tavern sin me casino resena beteum casino resena jqk bet casino resena jugabet casino es 2025 review como ganarle a la ruleta europea 23618 slots 7 casino resena 777onfire casino resena grand rush casino resena belliscasino dk resena mx betobet como retirar dinero desde mexico pragmatic play money money money bag win casino resena juego wicked circus jugar en un casino eth