I am trying to create meta fields to multiple custom taxonomy terms. I put the complete code inside a foreach but nothing is working.
$taxs = get_object_taxonomies( 'product' );
foreach($taxs as $terms){
add_action( "{$terms}_add_form_fields", '___add_form_field_term_meta_text' );
Is it possible to use the $terms
variable like that?
I am trying to create meta fields to multiple custom taxonomy terms. I put the complete code inside a foreach but nothing is working.
$taxs = get_object_taxonomies( 'product' );
foreach($taxs as $terms){
add_action( "{$terms}_add_form_fields", '___add_form_field_term_meta_text' );
Is it possible to use the $terms
variable like that?
1 Answer
Reset to default -1You can try this :
add_action( $terms.'_add_form_fields', '___add_form_field_term_meta_text' );
___add_form_field_term_meta_text
function. What does that look like? – Jacob Peattie Commented May 2, 2019 at 8:43init
. – Jacob Peattie Commented May 2, 2019 at 14:24