shaneM-6
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
| Status | Topic | Supporter | Voices | Posts | Freshness |
|---|---|---|---|---|---|
|
Apply multiple filters will crash the DB
Started by: shaneM-6 in: Toolset Professional Support |
|
2 | 2 | 3 years, 3 months ago | |
|
Checkboxes filter is not working with AND
Started by: shaneM-6
in: Toolset Professional Support
Problem: I want to have the checkboxes filter selection logic to be AND instead of the default OR. Solution: By default, the filter logic is OR. If you want to have AND you need to use the "wpv_filter_query". (It is considered as a custom coding and outside of the support scope) Example:
add_filter( 'wpv_filter_query', 'we_custom_search_criteria', 101, 3 );
function we_custom_search_criteria( $query_args ,$view_settings ) {
$view_id = 3142; // set view id (wpv_view_count)
if ( isset( $view_settings['view_id'] ) && $view_settings['view_id'] == $view_id ) {
foreach( (array)$query_args['meta_query'] as $k => $v ) :
if( isset( $v['relation'] ) && $v['relation'] == 'OR' ) {
$query_args['meta_query'][$k]['relation'] = 'AND';
}
endforeach;
}
return $query_args;
}
Relevant Documentation: https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query |
|
2 | 8 | 3 years, 10 months ago | |
|
Back button for filter is not working
Started by: shaneM-6 in: Toolset Professional Support |
|
2 | 6 | 4 years ago |