Fetch posts that match term slug first two letters (wp query)

Question

I want to fetch all posts whos terms matched the first two letters of the search letters, for example, i have terms 8027179,8027180,8247180 now i want if i assign letter 80 its fetch posts attached to 8027179 and 8027180, let me know if need more explanation, Thanks

                 $args =  array(
                'post_type' => 'tax-services',
                'order' => 'DESC',
                'posts_per_page' => -1,
                'tax_query' => array(
                    array(
                        'taxonomy' => 'store_number',
                        'field' => 'slug',
                        'terms' => '80',//first letters of slug
                    )
                  )
                );
0
Jamil Ahmad 3 months 0 Answers 13 views 0

Leave an answer