Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Created July 26, 2013 18:01
Show Gist options
  • Save WerdsWords/6090892 to your computer and use it in GitHub Desktop.
Save WerdsWords/6090892 to your computer and use it in GitHub Desktop.
#21: xmlrpc_default_taxonomy_fields
<?php
/**
* Only retrieve cap and object_type in taxonomy XML-RPC getters
*
* @see wp.getTaxonomy(), wp.getTaxonomies()
*
* @param array $fields An array of taxonomy fields.
* @param string $method The XML-RPC method name.
*
* @return array The filtered array of fields.
*/
function wpdocs_fewer_xmlrpc_tax_fields( $fields, $method ) {
return array( 'cap', 'object_type' );
}
add_filter( 'xmlrpc_default_taxonomy_fields', 'wpdocs_fewer_xmlrpc_tax_fields', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment