Alexander
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 |
---|---|---|---|---|---|
Show only search results with the search string at the beginning
Iniciado por: Alexander
en: Toolset Professional Support
Problem: Solution: Following is an example of such code, which needs editing for the ID(s) of the View(s) it should apply to, and the custom fields which should use this approach: function tssupp_filter_query($view_args, $view_settings, $view_id) { $views = array( 167 ); // comma-separated array of View IDs to modify $fields = array( 'wpcf-searchable' ); // comma-separated array of fields to modify filter of, including wpcf- prefix if ( in_array($view_id, $views ) && isset( $view_args['meta_query'] ) ) { $meta_queries = $view_args['meta_query']; foreach ($meta_queries as $key => $meta_query) { if ( in_array( $meta_query['key'], $fields ) ){ $view_args['meta_query'][$key]['value'] = '^'.$meta_query['value']; $view_args['meta_query'][$key]['compare'] = 'REGEXP'; } } } return $view_args; } add_filter('wpv_filter_query', 'tssupp_filter_query', 101, 3); Relevant Documentation: |
2 | 4 | hace 5 años, 6 meses | ||
Custom field filter showing incorrect results
Iniciado por: Alexander en: Toolset Professioneller Support |
2 | 6 | hace 5 años, 6 meses | ||
Query filter not returning correct results after update to Views 2.7
Iniciado por: Alexander en: Toolset Professional Support |
2 | 2 | hace 6 años, 1 mes |