• I am looking to have a checkbox on my form create an automatic tag to my custom post type. At the very bottom of my form I have a checkbox to make my listing featured I want it to create an automatic tag for that listing (EX: Featured Roping or Featured Clinic)

    http://teamroper.com/submit-an-event/

    I feel like this should be simple but Ive hit a mental block any help would be awesome

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    This checkbox is in a metabox you added? So you’ve probably hooked into an action in order to save the checkbox state. Use wp_set_object_terms() within this callback to assign a tag to the post if the checkbox is set.

    Even if you did not add the metabox, the form field is still in a metabox and it’s state is saved through some action. (‘save_post’?) Hook into the action and set the term if the checkbox is set.

Viewing 1 replies (of 1 total)
  • The topic ‘How do you make checkbox create automatic tag?’ is closed to new replies.