Filter: um_query_args_filter_global_meta

apply_filters( 'um_query_args_filter_global_meta', $skip, $member_directory_meta, $field, $value, $filter_type, $is_default ) → {bool}

Filters marker for skipping default filter handle in member directory queries. Hook handle filter queries for the custom usermeta table only.

Parameters:
Name Type Description
$skip bool

Skip default filter handler marker.

$member_directory_meta object

Member_Directory_Meta class instance.

$field string

Filter's field key.

$value mixed

Filter value.

$filter_type string

Filter type.

$is_default bool

If it's admin filtering option then true.

Since:
  • 2.1
Source:
Returns:

Skip default filter handler marker.

Type
bool
Example

Skip filter by rating default handler and add 3rd-party handlers in callback.

function um_custom_query_args_filter_global_meta( $skip, $member_directory_meta, $field, $value, $filter_type, $is_default ) {
    if ( 'filter_rating' === $field ) {
        $skip = true;
        $member_directory_meta->joins[] = "LEFT JOIN {$wpdb->prefix}um_metadata ummreviews ON ( ummreviews.user_id = u.ID AND ummreviews.um_key = '_reviews_avg' )";
    }
    return $skip;
}
add_filter( 'um_query_args_filter_global_meta', 'um_custom_query_args_filter_global_meta', 10, 6 );