Changeset 37914 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 06/29/2016 03:15:40 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r37890 r37914 1341 1341 if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) { 1342 1342 if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) 1343 return new IXR_Error( 401, __( ' You are not allowed to create posts as this user.' ) );1343 return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) ); 1344 1344 1345 1345 $author = get_userdata( $post_data['post_author'] ); … … 1635 1635 1636 1636 if ( ! current_user_can( 'delete_post', $post_id ) ) { 1637 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto delete this post.' ) );1637 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) ); 1638 1638 } 1639 1639 … … 1793 1793 1794 1794 if ( ! current_user_can( $post_type->cap->edit_posts ) ) 1795 return new IXR_Error( 401, __( ' You are not allowed to edit posts in this post type.' ));1795 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' )); 1796 1796 1797 1797 $query['post_type'] = $post_type->name; … … 1876 1876 1877 1877 if ( ! current_user_can( $taxonomy->cap->manage_terms ) ) 1878 return new IXR_Error( 401, __( ' You are not allowed to create terms in this taxonomy.' ) );1878 return new IXR_Error( 401, __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) ); 1879 1879 1880 1880 $taxonomy = (array) $taxonomy; … … 1963 1963 1964 1964 if ( ! current_user_can( $taxonomy->cap->edit_terms ) ) 1965 return new IXR_Error( 401, __( ' You are not allowed to edit terms in this taxonomy.' ) );1965 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) ); 1966 1966 1967 1967 $taxonomy = (array) $taxonomy; … … 2059 2059 2060 2060 if ( ! current_user_can( $taxonomy->cap->delete_terms ) ) 2061 return new IXR_Error( 401, __( ' You are not allowed to delete terms in this taxonomy.' ) );2061 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete terms in this taxonomy.' ) ); 2062 2062 2063 2063 $term = get_term( $term_id, $taxonomy->name ); … … 2130 2130 2131 2131 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 2132 return new IXR_Error( 401, __( ' You are not allowed to assign terms in this taxonomy.' ) );2132 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); 2133 2133 2134 2134 $term = get_term( $term_id , $taxonomy->name, ARRAY_A ); … … 2188 2188 2189 2189 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 2190 return new IXR_Error( 401, __( ' You are not allowed to assign terms in this taxonomy.' ) );2190 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); 2191 2191 2192 2192 $query = array(); … … 2283 2283 2284 2284 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 2285 return new IXR_Error( 401, __( ' You are not allowed to assign terms in this taxonomy.' ) );2285 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) ); 2286 2286 2287 2287 return $this->_prepare_taxonomy( $taxonomy, $fields ); … … 2471 2471 2472 2472 if ( ! current_user_can( 'list_users' ) ) 2473 return new IXR_Error( 401, __( ' You are not allowed to browse users.' ) );2473 return new IXR_Error( 401, __( 'Sorry, you are not allowed to browse users.' ) ); 2474 2474 2475 2475 $query = array( 'fields' => 'all_with_meta' ); … … 2795 2795 // Make sure the user can delete pages. 2796 2796 if ( !current_user_can('delete_page', $page_id) ) 2797 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto delete this page.' ) );2797 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this page.' ) ); 2798 2798 2799 2799 // Attempt to delete the page. … … 2857 2857 // Make sure the user is allowed to edit pages. 2858 2858 if ( !current_user_can('edit_page', $page_id) ) 2859 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto edit this page.' ) );2859 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) ); 2860 2860 2861 2861 // Mark this as content for a page. … … 3054 3054 // Make sure the user is allowed to add a category. 3055 3055 if ( !current_user_can('manage_categories') ) 3056 return new IXR_Error(401, __('Sorry, you do not have the rightto add a category.'));3056 return new IXR_Error(401, __('Sorry, you are not allowed to add a category.')); 3057 3057 3058 3058 // If no slug was provided make it empty so that … … 3129 3129 3130 3130 if ( !current_user_can('manage_categories') ) 3131 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto delete a category.' ) );3131 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete a category.' ) ); 3132 3132 3133 3133 $status = wp_delete_term( $category_id, 'category' ); … … 3227 3227 3228 3228 if ( ! current_user_can( 'edit_comment', $comment_id ) ) { 3229 return new IXR_Error( 403, __( ' You are not allowed to moderate or edit this comment.' ) );3229 return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); 3230 3230 } 3231 3231 … … 3359 3359 3360 3360 if ( !current_user_can( 'edit_comment', $comment_ID ) ) { 3361 return new IXR_Error( 403, __( ' You are not allowed to moderate or edit this comment.' ) );3361 return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); 3362 3362 } 3363 3363 … … 3426 3426 3427 3427 if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { 3428 return new IXR_Error( 403, __( ' You are not allowed to moderate or edit this comment.' ) );3428 return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); 3429 3429 } 3430 3430 … … 3630 3630 3631 3631 if ( ! current_user_can( 'publish_posts' ) ) { 3632 return new IXR_Error( 403, __( ' You are not allowed access to details about this site.' ) );3632 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); 3633 3633 } 3634 3634 … … 3671 3671 3672 3672 if ( ! current_user_can( 'edit_post', $post_id ) ) { 3673 return new IXR_Error( 403, __( ' You are not allowed access to details of this post.' ) );3673 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details of this post.' ) ); 3674 3674 } 3675 3675 … … 3711 3711 3712 3712 if ( !current_user_can( 'edit_posts' ) ) 3713 return new IXR_Error( 403, __( ' You are not allowed access to details about this site.' ) );3713 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); 3714 3714 3715 3715 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 3743 3743 3744 3744 if ( !current_user_can( 'edit_pages' ) ) 3745 return new IXR_Error( 403, __( ' You are not allowed access to details about this site.' ) );3745 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); 3746 3746 3747 3747 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 3775 3775 3776 3776 if ( !current_user_can( 'edit_pages' ) ) 3777 return new IXR_Error( 403, __( ' You are not allowed access to details about this site.' ) );3777 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); 3778 3778 3779 3779 $templates = get_page_templates(); … … 3869 3869 3870 3870 if ( !current_user_can( 'manage_options' ) ) 3871 return new IXR_Error( 403, __( ' You are not allowed to update options.' ) );3871 return new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) ); 3872 3872 3873 3873 $option_names = array(); … … 3921 3921 3922 3922 if ( !current_user_can( 'upload_files' ) ) 3923 return new IXR_Error( 403, __( ' You do not have permissionto upload files.' ) );3923 return new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) ); 3924 3924 3925 3925 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 3969 3969 3970 3970 if ( !current_user_can( 'upload_files' ) ) 3971 return new IXR_Error( 401, __( ' You do not have permissionto upload files.' ) );3971 return new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) ); 3972 3972 3973 3973 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 4013 4013 4014 4014 if ( !current_user_can( 'edit_posts' ) ) 4015 return new IXR_Error( 403, __( ' You are not allowed access to details about this site.' ) );4015 return new IXR_Error( 403, __( 'Sorry, you are not allowed access to details about this site.' ) ); 4016 4016 4017 4017 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 4683 4683 4684 4684 if ( ! current_user_can( 'edit_post', $post_ID ) ) { 4685 return new IXR_Error(401, __('Sorry, you do not have the rightto edit this post.'));4685 return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.')); 4686 4686 } 4687 4687 if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) { 4688 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto publish this post.' ) );4688 return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) ); 4689 4689 } 4690 4690 … … 4753 4753 4754 4754 if ( ! current_user_can( 'delete_post', $post_ID ) ) { 4755 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto delete this post.' ) );4755 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) ); 4756 4756 } 4757 4757 … … 4906 4906 case "post": 4907 4907 if ( !current_user_can( 'edit_others_posts' ) ) 4908 return new IXR_Error( 401, __( ' You are not allowed to create posts as this user.' ) );4908 return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) ); 4909 4909 break; 4910 4910 case "page": 4911 4911 if ( !current_user_can( 'edit_others_pages' ) ) 4912 return new IXR_Error( 401, __( ' You are not allowed to create pages as this user.' ) );4912 return new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) ); 4913 4913 break; 4914 4914 default: … … 5187 5187 5188 5188 if ( ! current_user_can( 'edit_post', $post_ID ) ) 5189 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto edit this post.' ) );5189 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 5190 5190 5191 5191 // Use wp.editPost to edit post types other than post and page. … … 5246 5246 case 'post': 5247 5247 if ( ! current_user_can( 'edit_others_posts' ) ) { 5248 return new IXR_Error( 401, __( ' You are not allowed to change the post author as this user.' ) );5248 return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the post author as this user.' ) ); 5249 5249 } 5250 5250 break; 5251 5251 case 'page': 5252 5252 if ( ! current_user_can( 'edit_others_pages' ) ) { 5253 return new IXR_Error( 401, __( ' You are not allowed to change the page author as this user.' ) );5253 return new IXR_Error( 401, __( 'Sorry, you are not allowed to change the page author as this user.' ) ); 5254 5254 } 5255 5255 break; … … 5358 5358 if ( 'publish' == $post_status || 'private' == $post_status ) { 5359 5359 if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) { 5360 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto publish this page.' ) );5360 return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this page.' ) ); 5361 5361 } elseif ( ! current_user_can( 'publish_posts' ) ) { 5362 return new IXR_Error( 401, __( 'Sorry, you do not have the rightto publish this post.' ) );5362 return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) ); 5363 5363 } 5364 5364 } … … 5791 5791 5792 5792 if ( !current_user_can('upload_files') ) { 5793 $this->error = new IXR_Error( 401, __( ' You do not have permissionto upload files.' ) );5793 $this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) ); 5794 5794 return $this->error; 5795 5795 }
Note: See TracChangeset
for help on using the changeset viewer.