Changeset 39464
- Timestamp:
- 12/03/2016 05:07:03 AM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r39179 r39464 428 428 case 'delete_term': 429 429 case 'assign_term': 430 $term_id = $args[0];430 $term_id = (int) $args[0]; 431 431 $term = get_term( $term_id ); 432 432 if ( ! $term || is_wp_error( $term ) ) { -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r39460 r39464 289 289 290 290 /** 291 * Checks if a request has access to read the specified term.291 * Checks if a request has access to read or edit the specified term. 292 292 * 293 293 * @since 4.7.0 … … 302 302 return false; 303 303 } 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 edit t erms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) );304 if ( 'edit' === $request['context'] && ! current_user_can( 'edit_term', (int) $request['id'] ) ) { 305 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) ); 306 306 } 307 307 return true;
Note: See TracChangeset
for help on using the changeset viewer.