The xmlrpc_default_taxonomy_fields
XML-RPC filter allows you to modify the default array of taxonomy fields to be retrieve with various methods.
It is evaluated in the wp.getTaxonomy()
and wp.getTaxonomies()
XML-RPC methods in the wp-includes/class-wp-xmlrpc-server.php file.
xmlrpc_default_taxonomy_fields
accepts 2 arguments:
array
An array of taxonomy fields to retrieve, defaults tolabels
,cap
, andobject_type
- string
wp.getTaxonomy|getTaxonomies
The method name with wp namespace
Example:
Let’s say you’re using the wp.getTaxonomy()
or wp.getTaxonomies()
method to retrieve taxonomy data for an XML-RPC project. And let’s say for some reason you won’t need to retrieve a taxonomy’s label data — maybe it’s for private use only or something. The following limits the taxonomy fields retrieved to cap
, and object_type
.
View the code example on Gist.