wp-includes/class-wp-xmlrpc-server.php:1324Creates a new post for any registered post type.
$argsarray$0int
$1string
$2string
$3arraydefault: 'post'
$post_statusstringdefault: 'draft' @type string $post_title Post title
$post_authorint
$post_excerptstring
$post_contentstring
$post_date_gmtstring
$post_datestring
$post_passwordstring
$comment_statusstring
$ping_statusstring
$stickybool
$post_thumbnailint
$custom_fieldsarray
$termsarray
$terms_namesarray
$enclosurearray
$urlstring
$lengthint
$typestring
int|IXR_ErrorOne hook fires while wp_xmlrpc_server::wp_newPost() runs, in this order:
Fires after the XML-RPC user has been authenticated but before the rest of the method logic begins.
public function wp_newPost( $args ) { if ( ! $this->minimum_args( $args, 4 ) ) { return $this->error; } $this->escape( $args ); $username = $args[1]; $password = $args[2]; $content_struct = $args[3]; $user = $this->login( $username, $password ); if ( ! $user ) { return $this->error; } // Convert the date field back to IXR form. if ( isset( $content_struct['post_date'] ) && ! ( $content_struct['post_date'] instanceof IXR_Date ) ) { $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] ); } /* * Ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct, * since _insert_post() will ignore the non-GMT date if the GMT date is set. */ if ( isset( $content_struct['post_date_gmt'] ) && ! ( $content_struct['post_date_gmt'] instanceof IXR_Date ) ) { if ( '0000-00-00 00:00:00' === $content_struct['post_date_gmt'] || isset( $content_struct['post_date'] ) ) { unset( $content_struct['post_date_gmt'] ); } else { $content_struct['post_date_gmt'] = $this->_convert_date( $content_struct['post_date_gmt'] ); } } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.newPost', $args, $this ); unset( $content_struct['ID'] ); return $this->_insert_post( $user, $content_struct ); }Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-xmlrpc-server.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.