Ticket #38857: 38857.2.patch
File 38857.2.patch, 6.4 KB (added by , 9 years ago) |
---|
-
src/wp-admin/edit-tags.php
18 18 wp_die( __( 'Invalid taxonomy.' ) ); 19 19 20 20 if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) { 21 wp_die( __( 'Sorry, you are not allowed to manage these items.' ) );21 wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) ); 22 22 } 23 23 24 24 if ( ! current_user_can( $tax->cap->manage_terms ) ) { 25 25 wp_die( 26 26 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 27 '<p>' . __( 'Sorry, you are not allowed to manage t hese items.' ) . '</p>',27 '<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>', 28 28 403 29 29 ); 30 30 } … … 74 74 if ( ! current_user_can( $tax->cap->edit_terms ) ) { 75 75 wp_die( 76 76 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 77 '<p>' . __( 'Sorry, you are not allowed to add this item.' ) . '</p>',77 '<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>', 78 78 403 79 79 ); 80 80 } -
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
117 117 } 118 118 119 119 if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { 120 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) );120 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); 121 121 } 122 122 123 123 if ( ! current_user_can( 'edit_posts' ) ) { … … 320 320 } 321 321 322 322 if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { 323 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) );323 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); 324 324 } 325 325 326 326 return true; -
src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
127 127 } 128 128 129 129 if ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) { 130 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );130 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); 131 131 } 132 132 133 133 $data = $this->prepare_item_for_response( $obj, $request ); -
src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
141 141 return false; 142 142 } 143 143 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) { 144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 145 145 } 146 146 } 147 147 -
src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
141 141 return false; 142 142 } 143 143 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) { 144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );144 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 145 145 } 146 146 return true; 147 147 } … … 302 302 return false; 303 303 } 304 304 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) { 305 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );305 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 306 306 } 307 307 return true; 308 308 } -
src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
148 148 } 149 149 150 150 if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) { 151 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) );151 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to browse users.' ), array( 'status' => rest_authorization_required_code() ) ); 152 152 } 153 153 154 154 if ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) {