mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
Combine some strings. props pavelevap. fixes #21087.
git-svn-id: http://core.svn.wordpress.org/trunk@21857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b523c3d597
commit
f431b408da
@ -62,7 +62,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
} else {
|
||||
return new WP_Error( 'edit_others_posts', $update ?
|
||||
__( 'You are not allowed to edit posts as this user.' ) :
|
||||
__( 'You are not allowed to post as this user.' )
|
||||
__( 'You are not allowed to create posts as this user.' )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -4055,18 +4055,18 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
$post_author = $user->ID;
|
||||
|
||||
// If an author id was provided then use it instead.
|
||||
if ( isset($content_struct['wp_author_id']) && ($user->ID != $content_struct['wp_author_id']) ) {
|
||||
if ( isset( $content_struct['wp_author_id'] ) && ( $user->ID != $content_struct['wp_author_id'] ) ) {
|
||||
switch ( $post_type ) {
|
||||
case "post":
|
||||
if ( !current_user_can('edit_others_posts') )
|
||||
return(new IXR_Error(401, __('You are not allowed to post as this user')));
|
||||
if ( !current_user_can( 'edit_others_posts' ) )
|
||||
return( new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) ) );
|
||||
break;
|
||||
case "page":
|
||||
if ( !current_user_can('edit_others_pages') )
|
||||
return(new IXR_Error(401, __('You are not allowed to create pages as this user')));
|
||||
if ( !current_user_can( 'edit_others_pages' ) )
|
||||
return( new IXR_Error( 401, __( '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' ) ) );
|
||||
break;
|
||||
}
|
||||
$author = get_userdata( $content_struct['wp_author_id'] );
|
||||
|
Loading…
Reference in New Issue
Block a user