Changeset 43440 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
- Timestamp:
- 07/13/2018 04:23:35 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r43087 r43440 85 85 } 86 86 foreach ( $taxonomies as $taxonomy ) { 87 if ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap-> manage_terms ) ) {87 if ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap->assign_terms ) ) { 88 88 return true; 89 89 } … … 114 114 $data = array(); 115 115 foreach ( $taxonomies as $tax_type => $value ) { 116 if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap-> manage_terms ) ) ) {116 if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap->assign_terms ) ) ) { 117 117 continue; 118 118 } … … 146 146 return false; 147 147 } 148 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap-> manage_terms ) ) {148 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->assign_terms ) ) { 149 149 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 150 150 }
Note: See TracChangeset
for help on using the changeset viewer.