Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the spinupwp domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /sites/coreysalzano.com/files/wp-includes/functions.php on line 6121
Editing Terms & Term Meta with the WordPress REST API – Corey Salzano

Editing Terms & Term Meta with the WordPress REST API

Here are some JavaScript snippets to manipulate WP_Term objects in WordPress using the REST API and the Backbone JavaScript client library.

Insert a term

Delete a term

This next example assumes you’ve used wp_localize_script() to make the REST API endpoint and a nonce available in an object myplugin. If you need help doing this, please leave a comment below and I’ll expand this example.

Edit a term meta value

Let’s add a term meta value to identify the number of speeds in this automatic transmission.

Thanks for reading. If you know a better way to edit terms and term meta in JavaScript, please leave a comment below.