xmlrpc_prepare_post_type
Filters XML-RPC-prepared date for the given post type.
Использование
add_filter( 'xmlrpc_prepare_post_type', 'wp_kama_xmlrpc_prepare_post_type_filter', 10, 2 ); /** * Function for `xmlrpc_prepare_post_type` filter-hook. * * @param array $_post_type An array of post type data. * @param WP_Post_Type $post_type Post type object. * * @return array */ function wp_kama_xmlrpc_prepare_post_type_filter( $_post_type, $post_type ){ // filter... return $_post_type; }
- $_post_type(массив)
- An array of post type data.
- $post_type(WP_Post_Type)
- Post type object.
Список изменений
С версии 3.4.0 | Введена. |
С версии 4.6.0 | Converted the $post_type parameter to accept a WP_Post_Type object. |
Где вызывается хук
xmlrpc_prepare_post_type
wp-includes/class-wp-xmlrpc-server.php 1049
return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );