Created
April 20, 2016 08:33
-
-
Save crewstyle/71e6715076abe27bad166fcccb9863e1 to your computer and use it in GitHub Desktop.
WordPress ~ WP version check for admin role only - #backend #security
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sets up WP version check for admin role only. | |
* | |
* @uses current_user_can() To know if current user has permissions. | |
* @uses add_action() To add a hook action. | |
* @uses add_filter() To add a hook filter. | |
* @see https://github.com/crewstyle/clean-wordpress | |
*/ | |
add_action('after_setup_theme', '_cw_remove_admin_wp_version_check'); | |
function _cw_remove_admin_wp_version_check() | |
{ | |
//Remove WORDPRESS update in the administration to all users, except the admin | |
if (!current_user_can('edit_users')) { | |
add_action('init', create_function('$a', "remove_action('init', 'wp_version_check');"), 2); | |
add_filter('pre_option_update_core', create_function('$a', "return null;")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment