WordPress.org

Make WordPress Core

Ticket #34521: 34521-you-cannot-----you are not allowed.patch

File 34521-you-cannot-----you are not allowed.patch, 6.2 KB (added by ramiy, 5 years ago)

"Sorry, you cannot" --> "Sorry, you are not allowed"

  • wp-includes/class-wp-xmlrpc-server.php

     
    17311731                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    17321732
    17331733                if ( ! current_user_can( 'edit_post', $post_id ) )
    1734                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     1734                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
    17351735
    17361736                return $this->_prepare_post( $post, $fields );
    17371737        }
     
    24122412                do_action( 'xmlrpc_call', 'wp.getUser' );
    24132413
    24142414                if ( ! current_user_can( 'edit_user', $user_id ) )
    2415                         return new IXR_Error( 401, __( 'Sorry, you cannot edit users.' ) );
     2415                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit users.' ) );
    24162416
    24172417                $user_data = get_userdata( $user_id );
    24182418
     
    25432543                do_action( 'xmlrpc_call', 'wp.getProfile' );
    25442544
    25452545                if ( ! current_user_can( 'edit_user', $user->ID ) )
    2546                         return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) );
     2546                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
    25472547
    25482548                $user_data = get_userdata( $user->ID );
    25492549
     
    25892589                do_action( 'xmlrpc_call', 'wp.editProfile' );
    25902590
    25912591                if ( ! current_user_can( 'edit_user', $user->ID ) )
    2592                         return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) );
     2592                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
    25932593
    25942594                // holds data of the user
    25952595                $user_data = array();
     
    26592659                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    26602660
    26612661                if ( !current_user_can( 'edit_page', $page_id ) )
    2662                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) );
     2662                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );
    26632663
    26642664                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    26652665                do_action( 'xmlrpc_call', 'wp.getPage' );
     
    27002700                        return $this->error;
    27012701
    27022702                if ( !current_user_can( 'edit_pages' ) )
    2703                         return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
     2703                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );
    27042704
    27052705                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    27062706                do_action( 'xmlrpc_call', 'wp.getPages' );
     
    29022902                        return $this->error;
    29032903
    29042904                if ( !current_user_can( 'edit_pages' ) )
    2905                         return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
     2905                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );
    29062906
    29072907                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    29082908                do_action( 'xmlrpc_call', 'wp.getPageList' );
     
    29582958                        return $this->error;
    29592959
    29602960                if ( !current_user_can('edit_posts') )
    2961                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     2961                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
    29622962
    29632963                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    29642964                do_action( 'xmlrpc_call', 'wp.getAuthors' );
     
    42864286                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    42874287
    42884288                if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
    4289                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     4289                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
    42904290
    42914291                // Check if revisions are disabled.
    42924292                if ( ! wp_revisions_enabled( $post ) )
     
    44554455                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    44564456
    44574457                if ( !current_user_can( 'edit_post', $post_ID ) )
    4458                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     4458                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
    44594459
    44604460                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    44614461                do_action( 'xmlrpc_call', 'blogger.getPost' );
     
    45084508                        return $this->error;
    45094509
    45104510                if ( ! current_user_can( 'edit_posts' ) )
    4511                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     4511                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
    45124512
    45134513                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    45144514                do_action( 'xmlrpc_call', 'blogger.getRecentPosts' );
     
    54835483                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    54845484
    54855485                if ( !current_user_can( 'edit_post', $post_ID ) )
    5486                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     5486                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
    54875487
    54885488                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    54895489                do_action( 'xmlrpc_call', 'metaWeblog.getPost' );
     
    56135613                        return $this->error;
    56145614
    56155615                if ( ! current_user_can( 'edit_posts' ) )
    5616                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     5616                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
    56175617
    56185618                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    56195619                do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' );
     
    58245824                        $post_id = (int) $data['post_id'];
    58255825
    58265826                        if ( ! current_user_can( 'edit_post', $post_id ) )
    5827                                 return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     5827                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
    58285828                }
    58295829                $attachment = array(
    58305830                        'post_title' => $name,
     
    60496049                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    60506050
    60516051                if ( !current_user_can('edit_post', $post_ID) )
    6052                         return new IXR_Error(401, __('Sorry, you cannot edit this post.'));
     6052                        return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.'));
    60536053
    60546054                $catids = array();
    60556055                foreach ( $categories as $cat ) {
     
    61686168                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    61696169
    61706170                if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
    6171                         return new IXR_Error(401, __('Sorry, you cannot publish this post.'));
     6171                        return new IXR_Error(401, __('Sorry, you are not allowed to publish this post.'));
    61726172
    61736173                $postdata['post_status'] = 'publish';
    61746174