pusatdata

Hide the WordPress update notifications from all users except administrators

Aug 7th, 2021
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. Hide the WordPress update notifications from all users except administrators
  2.  
  3.  
  4. The plugin
  5. Create a new folder under the wp-content/plugins folder of your installation and name it hide-update-notification or something similar. Inside it create a file called hide-update-notification.php or something similar. Inside the file paste this code.
  6.  
  7. <?php
  8. /**
  9. * Plugin Name: Hide Update Notifications
  10. * Plugin URI: https://cssigniter.com
  11. * Description: A small plugin to hide WordPress core update notifications from all users except administrators.
  12. * Version: 1.0
  13. * Author: cssigniter
  14. * Author URI: https://cssigniter.com
  15. * License: GPLv2 or later
  16. * License URI: http://www.gnu.org/licenses/gpl-2.0.html
  17. */
  18.  
  19. function hide_core_update_notifications_from_users() {
  20. if ( ! current_user_can( 'update_core' ) ) {
  21. remove_action( 'admin_notices', 'update_nag', 3 );
  22. }
  23. }
  24. add_action( 'admin_head', 'hide_core_update_notifications_from_users', 1 );
  25.  
  26.  
  27. ============================
  28.  
  29. https://www.cssigniter.com/hide-the-wordpress-update-notifications-from-all-users-except-administrators/
Advertisement
Add Comment
Please, Sign In to add comment