wphooks.info - xmlrpc_wp_insert_post_data

xmlrpc_wp_insert_post_data

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-wp-xmlrpc-server.php:
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
		$this->attach_uploads( $post_ID, $post_data['post_content'] );

		/**
		 * 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.
		 */
		$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );

		$post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );
		if ( is_wp_error( $post_ID ) ) {
			return new IXR_Error( 500, $post_ID->get_error_message() );
		}

		if ( ! $post_ID ) {
			return new IXR_Error( 401, __( 'Sorry, your entry could not be posted.' ) );
		}