rest api - Settingunsetting terms using the Backbone JavaScript client

admin2025-06-02  2

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?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748849391a314235.html

最新回复(0)