• Resolved watsonad

    (@watsonad)


    I want to save the actual taxonomy term, not the slug for the term, from my taxonomy radio group and taxonomy multicheck boxes. It appears that CMB2 assigns the slug as the value for the value parameter of the radio button and check box elements, and thus the slug is the saved value to the database. Therefore, when I get_post_data, the result is the slug. I’d rather have the actual term and not have to write case/switch code to reformat the slugs Any suggestions?

    https://wordpress.org/plugins/cmb2/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hello, I wasn’t finding any filters for that, so I’m not sure there’s a great way around it other than what you’re doing or using something like get_term_by() to get a term object that will have more available information about it in general.

    If someone else knows a better way around this, hopefully they speak up.

    Thread Starter watsonad

    (@watsonad)

    Followup:

    I’m using get_term_by() as suggested with the result of the get_post_meta call being the second parameter of the get_term_by() function.

    Thanks for the suggestion.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome. Worst case, this will be more assured for properly getting the term label.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom tax term, not slug’ is closed to new replies.