[wp-trac] [WordPress Trac] #56473: Getting notice message I am disabling update notifications

WordPress Trac noreply at wordpress.org
Wed Aug 31 10:45:49 UTC 2022


#56473: Getting notice message I am disabling update notifications
-----------------------------+------------------------------
 Reporter:  sumitsingh       |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Administration   |     Version:  5.9.3
 Severity:  normal           |  Resolution:
 Keywords:  has-screenshots  |     Focuses:  administration
-----------------------------+------------------------------

Comment (by sumitsingh):

 {{{#!php
 <?php
 // Disable WordPress update notifications
 function remove_core_updates(){
   global $wp_version;return(object) array('last_checked'=>
 time(),'version_checked'=> $wp_version,);
 }
 add_filter('pre_site_transient_update_core','remove_core_updates'); //hide
 WordPress updates for ALL users
 if ( !current_user_can('administrator') ) {
   add_filter('pre_site_transient_update_plugins','remove_core_updates');
 //hide all plugin updates for non-admins
   add_filter('pre_site_transient_update_themes','remove_core_updates');
 //hide all theme updates for non-admins
 }
 ?>

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56473#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list