xmlrpc_default_post_fields
Filters the default post query fields used by the given XML-RPC method.
Использование
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(массив)
- An array of post fields to retrieve. By default, contains 'post', 'terms', and 'custom_fields'.
- $method(строка)
- Method name.
Список изменений
С версии 3.4.0 | Введена. |
Где вызывается хук
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' );