cmb2-taxonomy icon indicating copy to clipboard operation
cmb2-taxonomy copied to clipboard

Does not appear to function properly with built in categories.

Open estin1985 opened this issue 9 years ago • 9 comments

A Category is a taxonomy type. Tested it with category listed as the object type, and it does not render any inputs.

estin1985 avatar Jun 29 '15 07:06 estin1985

Hi @estin1985, can you give me more details about the environment?

  • Wordpress version
  • CMB2 version
  • CMB2-taxonomy version

jcchavezs avatar Jul 06 '15 07:07 jcchavezs

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

estin1985 avatar Jul 13 '15 03:07 estin1985

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 avatar Sep 10 '15 10:09 danieljulia

@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);

}

marsshall avatar Sep 10 '15 17:09 marsshall

@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 :)

marsshall avatar Sep 10 '15 18:09 marsshall

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' );

danieljulia avatar Sep 14 '15 09:09 danieljulia

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 avatar Sep 14 '15 09:09 jcchavezs

@jcchavezs @danieljulia You're welcome :)

marsshall avatar Sep 14 '15 09:09 marsshall

By the way, I just added some documentation for the usage: https://github.com/jcchavezs/cmb2-taxonomy#usage. cc/ @danieljulia @marsshall

jcchavezs avatar Sep 14 '15 09:09 jcchavezs