diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 6e3ee0a13a..513bd1cdbf 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -5399,30 +5399,27 @@ class wp_xmlrpc_server extends IXR_Server { // Let WordPress generate the 'post_name' (slug) unless // one has been provided. - $post_name = ''; + $post_name = null; if ( isset( $content_struct['wp_slug'] ) ) { $post_name = $content_struct['wp_slug']; } // Only use a password if one was given. + $post_password = ''; if ( isset( $content_struct['wp_password'] ) ) { $post_password = $content_struct['wp_password']; - } else { - $post_password = ''; } // Only set a post parent if one was given. + $post_parent = 0; if ( isset( $content_struct['wp_page_parent_id'] ) ) { $post_parent = $content_struct['wp_page_parent_id']; - } else { - $post_parent = 0; } // Only set the 'menu_order' if it was given. + $menu_order = 0; if ( isset( $content_struct['wp_page_order'] ) ) { $menu_order = $content_struct['wp_page_order']; - } else { - $menu_order = 0; } $post_author = $user->ID; @@ -5450,8 +5447,8 @@ class wp_xmlrpc_server extends IXR_Server { $post_author = $content_struct['wp_author_id']; } - $post_title = isset( $content_struct['title'] ) ? $content_struct['title'] : null; - $post_content = isset( $content_struct['description'] ) ? $content_struct['description'] : null; + $post_title = isset( $content_struct['title'] ) ? $content_struct['title'] : ''; + $post_content = isset( $content_struct['description'] ) ? $content_struct['description'] : ''; $post_status = $publish ? 'publish' : 'draft'; @@ -5464,15 +5461,15 @@ class wp_xmlrpc_server extends IXR_Server { $post_status = $content_struct[ "{$post_type}_status" ]; break; default: - $post_status = $publish ? 'publish' : 'draft'; + // Deliberably left empty. break; } } - $post_excerpt = isset( $content_struct['mt_excerpt'] ) ? $content_struct['mt_excerpt'] : null; - $post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null; + $post_excerpt = isset( $content_struct['mt_excerpt'] ) ? $content_struct['mt_excerpt'] : ''; + $post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : ''; - $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null; + $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : array(); if ( isset( $content_struct['mt_allow_comments'] ) ) { if ( ! is_numeric( $content_struct['mt_allow_comments'] ) ) { @@ -5536,10 +5533,10 @@ class wp_xmlrpc_server extends IXR_Server { } if ( $post_more ) { - $post_content = $post_content . '' . $post_more; + $post_content .= '' . $post_more; } - $to_ping = null; + $to_ping = ''; if ( isset( $content_struct['mt_tb_ping_urls'] ) ) { $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array( $to_ping ) ) { @@ -5555,12 +5552,11 @@ class wp_xmlrpc_server extends IXR_Server { $dateCreated = $content_struct['dateCreated']->getIso(); } + $post_date = ''; + $post_date_gmt = ''; if ( ! empty( $dateCreated ) ) { $post_date = iso8601_to_datetime( $dateCreated ); $post_date_gmt = iso8601_to_datetime( $dateCreated, 'gmt' ); - } else { - $post_date = ''; - $post_date_gmt = ''; } $post_category = array(); @@ -5786,7 +5782,7 @@ class wp_xmlrpc_server extends IXR_Server { $menu_order = $content_struct['wp_page_order']; } - $page_template = null; + $page_template = ''; if ( ! empty( $content_struct['wp_page_template'] ) && 'page' === $post_type ) { $page_template = $content_struct['wp_page_template']; } @@ -5894,7 +5890,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_excerpt = $content_struct['mt_excerpt']; } - $post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null; + $post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : ''; $post_status = $publish ? 'publish' : 'draft'; if ( isset( $content_struct[ "{$post_type}_status" ] ) ) { @@ -5911,7 +5907,7 @@ class wp_xmlrpc_server extends IXR_Server { } } - $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null; + $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : array(); if ( 'publish' === $post_status || 'private' === $post_status ) { if ( 'page' === $post_type && ! current_user_can( 'publish_pages' ) ) { @@ -5925,7 +5921,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_content = $post_content . '' . $post_more; } - $to_ping = null; + $to_ping = ''; if ( isset( $content_struct['mt_tb_ping_urls'] ) ) { $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array( $to_ping ) ) { diff --git a/wp-includes/post.php b/wp-includes/post.php index be02cc401f..44f00898ab 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4034,6 +4034,7 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) { * child terms can have the same names with different parent terms, * so the only way to connect them is using ID. Default empty. * @type array $meta_input Array of post meta values keyed by their post meta key. Default empty. + * @type string $page_template Page template to use. * } * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e4ea386d6..c4bd2e9c07 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta1-54319'; +$wp_version = '6.1-beta1-54320'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.