Skip to content

Instantly share code, notes, and snippets.

@scottopolis
Last active February 25, 2021 18:54
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 scottopolis/a9b252d28dcd2aec826446635ac07f33 to your computer and use it in GitHub Desktop.
Save scottopolis/a9b252d28dcd2aec826446635ac07f33 to your computer and use it in GitHub Desktop.
Filter BuddyPress API Members
<?php
// add this code to a custom plugin
add_filter('bp_rest_members_get_items_query_args', function( $args, $request ) {
// These are just examples. Find available arguments here: https://codex.buddypress.org/developer/bp_user_query/
$args['search_terms'] = 'football';
$args['exclude'] = '1,2,3';
return $args;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment