shaneM-6
Admite hilos creados en los últimos 30 días: 0
Debates favoritos del foro
Este usuario no tiene debates favoritos.
Temas del foro creados
| Status | Debate | Supporter | Voces | Mensajes | Caducidad |
|---|---|---|---|---|---|
|
Apply multiple filters will crash the DB
Iniciado por: shaneM-6 en: Toolset Professional Support |
|
2 | 2 | 3 years, 5 months ago | |
|
Checkboxes filter is not working with AND
Iniciado por: shaneM-6
en: 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 | 4 years ago | |
|
Back button for filter is not working
Iniciado por: shaneM-6 en: Toolset Professional Support |
|
2 | 6 | 4 years, 2 months ago |