Changeset 43443 for branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
- Timestamp:
- 07/13/2018 06:28:29 AM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r41731 r43443 81 81 } 82 82 foreach ( $taxonomies as $taxonomy ) { 83 if ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap-> manage_terms ) ) {83 if ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap->assign_terms ) ) { 84 84 return true; 85 85 } … … 110 110 $data = array(); 111 111 foreach ( $taxonomies as $tax_type => $value ) { 112 if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap-> manage_terms ) ) ) {112 if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap->assign_terms ) ) ) { 113 113 continue; 114 114 } … … 142 142 return false; 143 143 } 144 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap-> manage_terms ) ) {144 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->assign_terms ) ) { 145 145 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); 146 146 }
Note: See TracChangeset
for help on using the changeset viewer.