buddydev

Untitled

Oct 13th, 2025
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. /**
  2.  * Exclude users with the specific level from directory.
  3.  */
  4. add_filter( 'mpp_main_gallery_query_args', 'mpp_custom_filter_dir_query_args' );
  5. add_filter( 'mpp_main_gallery_dir_ajax_query_args', 'mpp_custom_filter_dir_query_args' );
  6. function mpp_custom_filter_dir_query_args( $args ) {
  7.     // not the directory page.
  8.     if ( ! empty( $args['component'] ) ) {
  9.         return $args;
  10.     }
  11.  
  12.     // CHANGE this line.
  13.     $level_name            = "Basic";
  14.     $args['exclude_users'] = mpp_custom_get_pmpro_users_with_level_name( $level_name );
  15.  
  16.     return $args;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment