Advertisement
salmancreation

hide wp update notices and plugin

Dec 28th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. 1. To Disable Update WordPress nag :
  2.  
  3. Insert the following code to the functions.php file of your active theme. It will remove the WordPress update nag e.g. WordPress 3.9.1 is available! Please update now, from the all users dashboard, admin dashboard & from Updates page as well.
  4.  
  5. add_action('after_setup_theme','remove_core_updates');
  6. function remove_core_updates()
  7. {
  8.  if(! current_user_can('update_core')){return;}
  9.  add_action('init', create_function('$a',"remove_action( 'init', 'wp_version_check' );"),2);
  10.  add_filter('pre_option_update_core','__return_null');
  11.  add_filter('pre_site_transient_update_core','__return_null');
  12. }
  13.  
  14. 2. To Disable Plugin Update Notifications :
  15.  
  16. Insert the following code to the functions.php file of your active theme. It will remove the update notifications of all the installed plugins.
  17.  
  18. remove_action('load-update-core.php','wp_update_plugins');
  19. add_filter('pre_site_transient_update_plugins','__return_null');
  20.  
  21. 3. To Disable all the Nags & Notifications :
  22.  
  23. Insert the following code the functions.php file of your active theme. This code disables all the updates notifications regarding plugins, themes & WordPress completely.
  24.  
  25. function remove_core_updates(){
  26. global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
  27. }
  28. add_filter('pre_site_transient_update_core','remove_core_updates');
  29. add_filter('pre_site_transient_update_plugins','remove_core_updates');
  30. add_filter('pre_site_transient_update_themes','remove_core_updates');
  31.  
  32. Apart form these codes there are some WordPress plugins available to Disable WordPress Update Notifications & Nags :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement