xmlrpc_default_post_fields
Filters the default post query fields used by the given XML-RPC method.
Usage
add_filter( 'xmlrpc_default_post_fields', 'wp_kama_xmlrpc_default_post_fields_filter', 10, 2 ); /** * Function for `xmlrpc_default_post_fields` filter-hook. * * @param array $fields An array of post fields to retrieve. By default, contains 'post', 'terms', and 'custom_fields'. * @param string $method Method name. * * @return array */ function wp_kama_xmlrpc_default_post_fields_filter( $fields, $method ){ // filter... return $fields; }
- $fields(array)
- An array of post fields to retrieve. By default, contains 'post', 'terms', and 'custom_fields'.
- $method(string)
- Method name.
Changelog
Since 3.4.0 | Introduced. |
Where the hook is called
xmlrpc_default_post_fields
xmlrpc_default_post_fields
wp-includes/class-wp-xmlrpc-server.php 1923
$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
wp-includes/class-wp-xmlrpc-server.php 1984
$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );