Skip to content

Instantly share code, notes, and snippets.

@csalzano
Last active February 27, 2019 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csalzano/015e85e4655ec5a3033e0b4406729f4b to your computer and use it in GitHub Desktop.
Save csalzano/015e85e4655ec5a3033e0b4406729f4b to your computer and use it in GitHub Desktop.
JavaScript that inserts a term inside a WordPress custom taxonomy
//insert a term into our Transmission custom taxonomy
let term = new wp.api.models.Transmission( {
name: 'Automatic',
description: 'A vehicle transmission that self-shifts between gear ratios',
slug: 'automatic'
} );
term.save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment