How to filter WordPress taxonomy using the option value?

0 replies
I have a custom taxonomy, I am able to retrieve terms of taxonomy by below code

$terms = get_terms( array(
'taxonomy' => 'coupon_store',

) );
I have two option 1.affiliate_provider, 2.program_id I am adding those option by below code

$term_meta = array("affiliate_provider"=>'ABC',"program_id"=>'1 23');
update_option( "taxonomy_term_$termID", $term_meta );
Also I am able to get both options of the term by below code

$term_meta = get_option( "taxonomy_term_$termID" );
Here is my Issue:- I want to apply a filter on "get_terms" based on affiliate_provider options, I tried below code but not successed

$terms = get_terms( array(
'taxonomy' => 'coupon_store',
'meta_query' => array(
array(
'key' => 'affiliate_provider',
'value' => 'adrecord',
'compare' => '='
)
)
'hide_empty' => false,

) );
print_r($terms);
Can someone please recommend me a solution how I can do this? I tried a lot and followed forums but no solution...
Avatar of Unregistered

Trending Topics