To show terms in Bengali I enabled term meta fields, saving data into options
table. I made a custom function (get_term_meta()
) similar to post_meta to fetch my taxonomy meta data, that takes term_id and the term_meta_key as parameters. How can I use a function so that I can filter my default term titles with the term meta I defined. I tried:
function bn_term_title() {
var_dump($term);
/*if( get_locale() === 'bn_BD' )
return get_term_meta( $term->term_id, 'term_bn' );*/
}
add_filter( 'single_term_title', 'bn_term_title' );
But var_dump( $term );
returns null
. How can I get the term_id inside the function?
P.S.: get_term_meta()
acts like: get_option( "option_key_name{$term_id}" );