Last active
December 20, 2015 14:39
-
-
Save WerdsWords/6148183 to your computer and use it in GitHub Desktop.
#28: autocomplete_users_for_site_admins
This file contains 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 | |
/** | |
* Enable user auto-complete for non-super admins who have the promote_users cap. | |
* | |
* @see wp_ajax_autocomplete_user() | |
* | |
* @param bool $yesno Whether to allow non-super admins to use user autocomplete. Defaults to false. | |
* | |
* @return bool Whether to allow it. | |
*/ | |
function wpdocs_ms_user_autocomplete( $yesno ) { | |
if ( current_user_can( 'promote_users' ) ) | |
return true; | |
else | |
return false; | |
} | |
add_filter( 'autocomplete_users_for_site_admins', 'wpdocs_ms_user_autocomplete' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment