Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'kleo_ajax_query_args', function ( $args ) {
- // load the terms using LIKE search
- $term_ids = get_terms( [
- 'name__like' => $_REQUEST['s'],
- 'fields' => 'ids',
- 'taxonomy' => 'post_tag',
- 'hide_empty' => true
- ] );
- $args['tax_query'] = [
- 'relation' => 'OR',
- [
- 'taxonomy' => 'post_tag',
- 'field' => 'id',
- 'terms' => $term_ids
- ]
- ];
- return $args;
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement