Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/e5c6e45833ff4aaac762d351ef004d51 to your computer and use it in GitHub Desktop.
Save champsupertramp/e5c6e45833ff4aaac762d351ef004d51 to your computer and use it in GitHub Desktop.
Ultimate Member - Hides current user from search query in member directory
<?php
/**
* Hides current user from search query in member directory
*/
add_filter('um_prepare_user_query_args', 'um_remove_current_user_from_query', 10, 2);
function um_remove_current_user_from_query( $query_args, $args ){
$query_args['exclude'] = array( get_current_user_id() );
return $query_args;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment