From 866bd39813521331d688d843f79bc5cfd545be5f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Jul 2016 16:05:31 +0000 Subject: [PATCH] I18N: Combine two duplicate "Invalid post type" strings. Props @ramiy. See #18218. Built from https://develop.svn.wordpress.org/trunk@38076 git-svn-id: http://core.svn.wordpress.org/trunk@38017 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 4 ++-- wp-admin/post-new.php | 2 +- wp-includes/class-wp-xmlrpc-server.php | 12 ++++++------ wp-includes/post.php | 2 +- wp-includes/version.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 92e670f726..59cb4f1954 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -10,7 +10,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! $typenow ) - wp_die( __( 'Invalid post type' ) ); + wp_die( __( 'Invalid post type.' ) ); if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) ); @@ -32,7 +32,7 @@ $post_type = $typenow; $post_type_object = get_post_type_object( $post_type ); if ( ! $post_type_object ) - wp_die( __( 'Invalid post type' ) ); + wp_die( __( 'Invalid post type.' ) ); if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { wp_die( diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index 91bdb785fe..ac80f1350f 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -21,7 +21,7 @@ if ( ! isset( $_GET['post_type'] ) ) { } elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) { $post_type = $_GET['post_type']; } else { - wp_die( __('Invalid post type') ); + wp_die( __( 'Invalid post type.' ) ); } $post_type_object = get_post_type_object( $post_type ); diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 48b18a4f2f..71b1e1c603 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -1302,7 +1302,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_type = get_post_type_object( $post_data['post_type'] ); if ( ! $post_type ) - return new IXR_Error( 403, __( 'Invalid post type' ) ); + return new IXR_Error( 403, __( 'Invalid post type.' ) ); $update = ! empty( $post_data['ID'] ); @@ -4098,7 +4098,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action( 'xmlrpc_call', 'wp.getPostType' ); if ( ! post_type_exists( $post_type_name ) ) - return new IXR_Error( 403, __( 'Invalid post type' ) ); + return new IXR_Error( 403, __( 'Invalid post type.' ) ); $post_type = get_post_type_object( $post_type_name ); @@ -4857,7 +4857,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_type = 'post'; } else { // No other post_type values are allowed here - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } else { if ( $publish ) @@ -4915,7 +4915,7 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) ); break; default: - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } $author = get_userdata( $content_struct['wp_author_id'] ); if ( ! $author ) @@ -5193,7 +5193,7 @@ class wp_xmlrpc_server extends IXR_Server { // Use wp.editPost to edit post types other than post and page. if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) ) - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); // Thwart attempt to change the post type. if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) ) @@ -5257,7 +5257,7 @@ class wp_xmlrpc_server extends IXR_Server { } break; default: - return new IXR_Error( 401, __( 'Invalid post type' ) ); + return new IXR_Error( 401, __( 'Invalid post type.' ) ); } $post_author = $content_struct['wp_author_id']; } diff --git a/wp-includes/post.php b/wp-includes/post.php index 225f8dbf39..b6c2fae08a 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1069,7 +1069,7 @@ function unregister_post_type( $post_type ) { global $wp_post_types; if ( ! post_type_exists( $post_type ) ) { - return new WP_Error( 'invalid_post_type', __( 'Invalid post type' ) ); + return new WP_Error( 'invalid_post_type', __( 'Invalid post type.' ) ); } $post_type_object = get_post_type_object( $post_type ); diff --git a/wp-includes/version.php b/wp-includes/version.php index cbb3c108cb..ab2a333bfb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta3-38075'; +$wp_version = '4.6-beta3-38076'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.