Alexander
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
---|---|---|---|---|---|
Show only search results with the search string at the beginning
Gestartet von: Alexander
in: 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 | vor 5 Jahren, 4 Monaten | ||
Custom field filter showing incorrect results
Gestartet von: Alexander in: Toolset Professioneller Support |
2 | 6 | vor 5 Jahren, 4 Monaten | ||
Query filter not returning correct results after update to Views 2.7
Gestartet von: Alexander in: Toolset Professional Support |
2 | 2 | vor 5 Jahren, 12 Monaten |