• Is it possible to include additional data that will be sent to the $_POST or $args variable that is received by the saved_{taxonomy} hook?

    I have a small piece of data I would like to gather from the user when they create a new term, and I’m hoping to have it show up in this hook without needing to do something like send a separate ajax request from the javascript that is running on the Add New Term page.

    In the past, I have sent this data with an ajax request to the server, and then stored the data in the term_meta so that it could be retrieved later when the term is finally saved.

    But this introduces a coordination problem where the post can’t be saved until the ajax request completes, otherwise it won’t have access to this additional data.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You’d need to add an additional field to the form used to define a term. The source code for the form likely has a few action hooks you can use to output additional fields. As part of the form, the field value will be within $_POST and you can save it through any action that fires as part of saving the default fields.

    The easy way to manage this is by using a custom fields plugin, but you can roll your own code if you prefer.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding $_POST Data sent when saving new term’ is closed to new replies.