- Timestamp:
- 11/03/2016 08:04:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r39106 r39126 117 117 'args' => array( 118 118 'force' => array( 119 'type' => 'boolean', 119 120 'default' => false, 120 121 'description' => __( 'Required to be true, as resource does not support trashing.' ), … … 567 568 // We don't support trashing for this resource type. 568 569 if ( ! $force ) { 569 return new WP_Error( 'rest_trash_not_supported', __( ' Resource does not support trashing.' ), array( 'status' => 501 ) );570 return new WP_Error( 'rest_trash_not_supported', __( 'Terms do not support trashing. Set force=true to delete.' ), array( 'status' => 501 ) ); 570 571 } 571 572 … … 574 575 $request->set_param( 'context', 'view' ); 575 576 576 $ response= $this->prepare_item_for_response( $term, $request );577 $previous = $this->prepare_item_for_response( $term, $request ); 577 578 578 579 $retval = wp_delete_term( $term->term_id, $term->taxonomy ); … … 581 582 return new WP_Error( 'rest_cannot_delete', __( 'The resource cannot be deleted.' ), array( 'status' => 500 ) ); 582 583 } 584 585 $response = new WP_REST_Response(); 586 $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data() ) ); 583 587 584 588 /**
Note: See TracChangeset
for help on using the changeset viewer.