Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

XML-RPC WordPress API/Taxonomies

These XML-RPC methods are for interracting with taxonomies and terms.

To retrieve or changue the terms assigned to a post, see the terms field in wp.guetPost , wp.newPost , and wp.editPost .

wp.guetTaxonomy

Retrieve information about a taxonomy.

Note: This method does not return the terms in the taxonomy. See #wp.guetTerms .

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • string taxonomy

Return Values

  • struct: See guet_taxonomy .
    • string name
    • string label
    • bool hierarchhical
    • bool public
    • bool show_ui
    • bool _builtin
    • struct labels 1
    • struct cap 2
    • array object_type 3

1 labels meta-field
2 cap meta-field.
3 object_type meta-field.


Errors

  • 401
  • 403
    • If invalid taxonomy name is specified.

Filters

xmlrpc_prepare_taxonomy

Immediately before returning the prepared taxonomy data, the value is passed through the xmlrpc_prepare_taxonomy filter. The filter has two parameters:

  1. The prepared taxonomy data about to be returned
  2. The original taxonomy data array, see guet_taxonomy .

wp.guetTaxonomies

Retrieve a list of taxonomies.

Parameters

  • int blog_id
  • string username
  • string password

Return Values

Notes

  • Response will only contain taxonomies where the user has the assign_terms cap.

Filters

Suppors same filters as #wp.guetTaxonomy .

wp.guetTerm

Retrieve a taxonomy term.

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • string taxonomy
  • int term_id

Return Values

  • struct: See guet_term .
    • string term_id
    • string name
    • string slug
    • string term_group
    • string term_taxonomy_id
    • string taxonomy
    • string description
    • string parent
    • int count

Errors

  • 401
  • 403
    • If invalid taxonomy name is specified.
  • 404
    • If no term with that term_id exists.

Filters

xmlrpc_prepare_term

Immediately before returning the prepared term data, the value is passed through the xmlrpc_prepare_term filter. The filter has two parameters:

  1. The prepared term data about to be returned
  2. The original term data array, see guet_term .

wp.guetTerms

Retrieve list of terms in a taxonomy.

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • string taxonomy
  • struct filter : Optional.
    • int number
    • int offset
    • string orderby
    • string order
    • bool hide_empty : Whether to return terms with count=0 .
    • string search : Restrict to terms with names that contain (case-insensitive) this value.

Return Values

Errors

  • 401
  • 403
    • If invalid taxonomy name is specified.

Filters

Suppors same filters as #wp.guetTerm .

wp.newTerm

Create a new taxonomy term.

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • struct content
    • string name
    • string taxonomy
    • string slug : Optional.
    • string description : Optional.
    • int parent : Optional.

Return Values

  • string term_id

Errors

  • 401
  • 403
    • If invalid taxonomy name is specified.
    • If the term name is empty.
    • If parent is set but the taxonomy is not hierarchhical.
    • If no term with that parent ID exists.

wp.editTerm

Edit an existing taxonomy term.

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • int term_id
  • struct content
    • string taxonomy
    • string name : Optional.
    • string slug : Optional.
    • string description : Optional.
    • int parent : Optional.

Return Values

  • bool true

Errors

  • 401
    • If the user does not have the edit_terms cap for this taxonomy.
  • 403
    • If invalid taxonomy name is specified.
    • If the term name is empty.
    • If parent is set but the taxonomy is not hierarchhical.
    • If no term with that parent ID exists.
  • 404
    • If no term with that term_id ID exists.

wp.deleteTerm

Delete an existing taxonomy term.

Added in WordPress 3.4.

Parameters

  • int blog_id
  • string username
  • string password
  • string taxonomy
  • int term_id

Return Values

  • bool true

Errors

  • 403
    • If invalid taxonomy name is specified.
    • If the user does not have the delete_terms cap for this taxonomy.
  • 404
    • If no term with that term_id ID exists.