Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Oct 31, 2022
1 parent a550b41 commit c5cfd11
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions includes/REST_API/Stories_Taxonomies_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,20 @@ public function __construct() {
* @return WP_REST_Response Response object.
*/
public function prepare_item_for_response( $taxonomy, $request ): WP_REST_Response {
$old_response = parent::prepare_item_for_response( $taxonomy, $request );
$old_response = parent::prepare_item_for_response( $taxonomy, $request );

// Wrap the data in a response object.
$response = rest_ensure_response( $old_response->get_data() );
/**
* Response data.
*
* @var array<string,mixed> $data
*/
$data = $old_response->get_data();
/**
* Response object.
*
* @var WP_REST_Response $response
*/
$response = rest_ensure_response( $data );
$response->add_links( $this->prepare_links( $taxonomy ) );

/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php */
Expand Down

0 comments on commit c5cfd11

Please sign in to comment.