Consolodate some strings. Props pavelevap. fixes #20809

git-svn-id: http://core.svn.wordpress.org/trunk@20972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-06-01 19:05:30 +00:00
parent af5697e83b
commit eaa419dba3
2 changed files with 20 additions and 20 deletions

View File

@ -1473,7 +1473,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.newTerm' ); do_action( 'xmlrpc_call', 'wp.newTerm' );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $content_struct['taxonomy'] ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] );
@ -1561,7 +1561,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.editTerm' ); do_action( 'xmlrpc_call', 'wp.editTerm' );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $content_struct['taxonomy'] ); $taxonomy = get_taxonomy( $content_struct['taxonomy'] );
@ -1653,7 +1653,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.deleteTerm' ); do_action( 'xmlrpc_call', 'wp.deleteTerm' );
if ( ! taxonomy_exists( $taxonomy ) ) if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
@ -1720,7 +1720,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTerm' ); do_action( 'xmlrpc_call', 'wp.getTerm' );
if ( ! taxonomy_exists( $taxonomy ) ) if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
@ -1773,7 +1773,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTerms' ); do_action( 'xmlrpc_call', 'wp.getTerms' );
if ( ! taxonomy_exists( $taxonomy ) ) if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
@ -1852,7 +1852,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTaxonomy' ); do_action( 'xmlrpc_call', 'wp.getTaxonomy' );
if ( ! taxonomy_exists( $taxonomy ) ) if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
$taxonomy = get_taxonomy( $taxonomy ); $taxonomy = get_taxonomy( $taxonomy );
@ -2950,7 +2950,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'upload_files' ) ) if ( !current_user_can( 'upload_files' ) )
return new IXR_Error( 403, __( 'You are not allowed to upload files to this site.' ) ); return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) );
do_action('xmlrpc_call', 'wp.getMediaItem'); do_action('xmlrpc_call', 'wp.getMediaItem');
@ -2995,7 +2995,7 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error; return $this->error;
if ( !current_user_can( 'upload_files' ) ) if ( !current_user_can( 'upload_files' ) )
return new IXR_Error( 401, __( 'Sorry, you cannot upload files.' ) ); return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
do_action('xmlrpc_call', 'wp.getMediaLibrary'); do_action('xmlrpc_call', 'wp.getMediaLibrary');
@ -3104,7 +3104,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getPostType' ); do_action( 'xmlrpc_call', 'wp.getPostType' );
if( ! post_type_exists( $post_type_name ) ) 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 ); $post_type = get_post_type_object( $post_type_name );
@ -3679,7 +3679,7 @@ class wp_xmlrpc_server extends IXR_Server {
$post_type = 'post'; $post_type = 'post';
} else { } else {
// No other post_type values are allowed here // 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 { } else {
if ( $publish ) if ( $publish )
@ -3735,7 +3735,7 @@ class wp_xmlrpc_server extends IXR_Server {
return(new IXR_Error(401, __('You are not allowed to create pages as this user'))); return(new IXR_Error(401, __('You are not allowed to create pages as this user')));
break; break;
default: default:
return(new IXR_Error(401, __('Invalid post type.'))); return(new IXR_Error(401, __('Invalid post type')));
break; break;
} }
$author = get_userdata( $content_struct['wp_author_id'] ); $author = get_userdata( $content_struct['wp_author_id'] );
@ -3987,7 +3987,7 @@ class wp_xmlrpc_server extends IXR_Server {
// Use wp.editPost to edit post types other than post and page. // Use wp.editPost to edit post types other than post and page.
if ( ! in_array( $postdata[ 'post_type' ], array( 'post', '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. // Thwart attempt to change the post type.
if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) ) if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) )
@ -4039,7 +4039,7 @@ class wp_xmlrpc_server extends IXR_Server {
return(new IXR_Error(401, __('You are not allowed to change the page author as this user.'))); return(new IXR_Error(401, __('You are not allowed to change the page author as this user.')));
break; break;
default: default:
return(new IXR_Error(401, __('Invalid post type.'))); return(new IXR_Error(401, __('Invalid post type')));
break; break;
} }
$post_author = $content_struct['wp_author_id']; $post_author = $content_struct['wp_author_id'];
@ -4531,7 +4531,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action('xmlrpc_call', 'metaWeblog.newMediaObject'); do_action('xmlrpc_call', 'metaWeblog.newMediaObject');
if ( !current_user_can('upload_files') ) { if ( !current_user_can('upload_files') ) {
$this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.')); $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
return $this->error; return $this->error;
} }

View File

@ -502,7 +502,7 @@ function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) {
foreach ( (array) $taxonomies as $taxonomy ) { foreach ( (array) $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) if ( ! taxonomy_exists( $taxonomy ) )
return new WP_Error( 'invalid_taxonomy', __( 'Invalid Taxonomy' ) ); return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
} }
$defaults = array( 'order' => 'ASC' ); $defaults = array( 'order' => 'ASC' );
@ -855,7 +855,7 @@ function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
} }
if ( ! taxonomy_exists($taxonomy) ) { if ( ! taxonomy_exists($taxonomy) ) {
$error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); $error = new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
return $error; return $error;
} }
@ -984,7 +984,7 @@ function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw
*/ */
function get_term_children( $term_id, $taxonomy ) { function get_term_children( $term_id, $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) ) if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
$term_id = intval( $term_id ); $term_id = intval( $term_id );
@ -1174,7 +1174,7 @@ function &get_terms($taxonomies, $args = '') {
foreach ( $taxonomies as $taxonomy ) { foreach ( $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) ) { if ( ! taxonomy_exists($taxonomy) ) {
$error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); $error = new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
return $error; return $error;
} }
} }
@ -1875,7 +1875,7 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
foreach ( (array) $taxonomies as $taxonomy ) { foreach ( (array) $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) ) if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
} }
if ( !is_array($object_ids) ) if ( !is_array($object_ids) )
@ -2146,7 +2146,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
$object_id = (int) $object_id; $object_id = (int) $object_id;
if ( ! taxonomy_exists($taxonomy) ) if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
if ( !is_array($terms) ) if ( !is_array($terms) )
$terms = array($terms); $terms = array($terms);