xmlrpc_prepare_post_type
Filter HookDescription
Filters XML-RPC-prepared date for the given post type.Hook Information
File Location |
wp-includes/class-wp-xmlrpc-server.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1060 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$_post_type
|
An array of post type data. |
WP_Post_Type
|
$post_type
|
Post type object. |
Usage Examples
Basic Usage
<?php
// Hook into xmlrpc_prepare_post_type
add_filter('xmlrpc_prepare_post_type', 'my_custom_filter', 10, 2);
function my_custom_filter($_post_type, $post_type) {
// Your custom filtering logic here
return $_post_type;
}
Source Code Context
wp-includes/class-wp-xmlrpc-server.php:1060
- How this hook is used in WordPress core
<?php
1055 * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.
1056 *
1057 * @param array $_post_type An array of post type data.
1058 * @param WP_Post_Type $post_type Post type object.
1059 */
1060 return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );
1061 }
1062
1063 /**
1064 * Prepares media item data for return in an XML-RPC object.
1065 *
PHP Documentation
<?php
/**
* Filters XML-RPC-prepared date for the given post type.
*
* @since 3.4.0
* @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.
*
* @param array $_post_type An array of post type data.
* @param WP_Post_Type $post_type Post type object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks
Related hooks will be displayed here in future updates.