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 *

guides can a pcp c6b7 treat erectile dysfunction exploring primary care solutions for ed revolutionize your sex life with cbd gummies for women unlock a world of pleasure and relaxation article top male enhancement drug sold in stores clinically proven safe 29b232 for optimal performance blogs cbd gummies for ed cost dbe75 analysis and medical considerations wellness find sex pills shop near me f8303ee3 trusted effective options available questions ancient rituals and the quest b9ffpenis for male enhancement secrets behind penis enlargement practices article buy generic 7159penis viagra online discount prices fast shipping the benefits of cvs men 39 s multivitamin gummies for a healthy lifestyle collections vitalmaxxt male enhancement solution boost cb696d performance naturally with clinical results guides proven 35b98e1a methods for penis enlargement what works and what doesn t article understanding the 629b2 relationship between glyceryl trinitrate and erectile dysfunction medications thmfausq the secret to a slimmer you kelly e2a6d18c clarkson s weight loss gummies on shark tank ucqmnabyr medications to enhance libido a doctor s guide to sexual dfd200 health blue burn keto gummies are they effective media b935penis viagra and jet lag the surprising science behind potential benefits cyotlnvsh how 99259123 much does a viagra pill cost a comprehensive guide to pricing and availability lifestyle top fruits to enhance erectile health 455amale naturally a guide to natural remedies finding the erectile dysfunction opposite a comprehensive guide to achieving optimal sexual wbrklz free male enhancement no credit d4bf card instant results no payment required reviews black ant male 77e48b enhancement supplements natural support for enhanced sexual health and vitality