Custom Fields
Re-Envisioned
Support Meta Box Group Taxonomy field not setting post term when inside Cloneable Group

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 5 months ago.

  • Creator
    Topic
  • #12046
    Resolved
    Clayton Collie
    Participant

    I have a group of fields. One of them is a taxonomy field. On save, the term is not being set to the post object. Can I use the taxonomy field inside a group?

    I see the term ID being saved to the database as post_meta since the entire group is being saved as a serialized array.

    Just for troubleshooting sake, when the group is set to clone true or false and sort is set to true or false, the post term is not set.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #12054

    Anh Tran
    Keymaster

    Hi Clayton,

    Unfortunately, the group field saves all values of its children into 1 array, and bypass the behavior of the taxonomy field. If you want to set post terms, then it’s a connection between post and terms. Therefore, a top-level taxonomy makes sense, e.g. don’t put it inside a group.

    #12129

    Clayton Collie
    Participant

    I really need this functionality so I wrote a function that runs on save_post. Hopefully is helps somebody else.

    https://ghostbin.com/paste/d92ys

    #12141

    Anh Tran
    Keymaster

    Awesome! Thanks a lot for your contribution!

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

You must be logged in to reply to this topic.