Filter hook 'xmlrpc_wp_insert_post_data'

in WP Core File wp-includes/class-wp-xmlrpc-server.php at line 1696

View Source

xmlrpc_wp_insert_post_data

Filter Hook
Description
Filters post data array to be inserted via XML-RPC.

Hook Information

File Location wp-includes/class-wp-xmlrpc-server.php View on GitHub
Hook Type Filter
Line Number 1696

Hook Parameters

Type Name Description
array $post_data Parsed array of post data.
array $content_struct Post data array.

Usage Examples

Basic Usage
<?php
// Hook into xmlrpc_wp_insert_post_data
add_filter('xmlrpc_wp_insert_post_data', 'my_custom_filter', 10, 2);

function my_custom_filter($post_data, $content_struct) {
    // Your custom filtering logic here
    return $post_data;
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:1696 - How this hook is used in WordPress core
<?php
1691  		 * @since 3.4.0
1692  		 *
1693  		 * @param array $post_data      Parsed array of post data.
1694  		 * @param array $content_struct Post data array.
1695  		 */
1696  		$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );
1697  
1698  		// Remove all null values to allow for using the insert/update post default values for those keys instead.
1699  		$post_data = array_filter(
1700  			$post_data,
1701  			static function ( $value ) {

PHP Documentation

<?php
/**
		 * Filters post data array to be inserted via XML-RPC.
		 *
		 * @since 3.4.0
		 *
		 * @param array $post_data      Parsed array of post data.
		 * @param array $content_struct Post data array.
		 */
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.