Created
March 19, 2019 12:18
-
-
Save gianghl1983/bf6fb28d703f479f034398ea133075b5 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* 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
Do you know if it is possible to hide the current user from the directory completely (ie on initial load)?