I'd like to set and delete terms in my custom taxonomy using the WordPress Backbone JavaScript client, which provides access to the REST API in JavaScript.
I can't find an example or suggestion in the documentation about how to add and delete terms in my custom taxonomy. I have verified that the taxonomy itself is shown in the client - I can load it using
var taxonomy = new wp.api.models.My_custom_taxonomy().fetch();
where My_custom_taxonomy
is created by the JavaScript client by inspecting the REST API. I can verify that taxonomy
contains useful information by inspecting it in my console. For example, taxonomy.responseJSON
contains an array with the description, ID, link to the REST API endpoint, etc. for my taxonomy - so that part is working. But can I set and delete terms in this taxonomy via the JavaScript client?