Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Last active December 20, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WerdsWords/6148183 to your computer and use it in GitHub Desktop.
Save WerdsWords/6148183 to your computer and use it in GitHub Desktop.
#28: autocomplete_users_for_site_admins
<?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