Open estin1985 opened 9 years ago
Hi @estin1985, can you give me more details about the environment?
Sure! I am using the latest CMB2 (2.0.8), wordpress latest and CMB2-Taxonomy latest. It can easily be tested, just use the example functions but change the object_types array to have category. Category is a taxonomy type, but this plugin does not render in for the default categories. If it did, this would be an excellent replacement for Taxonomy MetaData
I'm getting always empty values with a custom taxonomy.. last version of cmb2 and cmb2-taxonomy f.i. $autor is the custom taxonomy term get_post_meta( $autor->term_id, '_myprefix_foto' ); returns an empty array (the id and name is correct)
@danieljulia me too, with same approach... :(
$tax = 'prod_category';
$tax_terms = get_terms($tax);
foreach ($tax_terms as $key => $tax_term) {
$prefix = '_prod_category_';
$tax_icon = get_post_meta($tax_term->term_id, $prefix.'icon', true);
}
@danieljulia We r using get_post_meta, but for term is necessary to use get_term_meta. There are no instruction to do this, but exploring plugin functions.php I found it.
Hope this help you :)
You are right!! Thanks!
in my sample would be get_term_meta( $autor->term_id, '_myprefix_foto' ); instead of get_post_meta( $autor->term_id, '_myprefix_foto' );
Thank you @marsshall for the assitance. I am extremely busy this days so I could not follow up this issue. I will add the documentation for this soon.
@jcchavezs @danieljulia You're welcome :)
By the way, I just added some documentation for the usage: https://github.com/jcchavezs/cmb2-taxonomy#usage. cc/ @danieljulia @marsshall
A Category is a taxonomy type. Tested it with category listed as the object type, and it does not render any inputs.