Changeset 53760 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
- Timestamp:
- 07/22/2022 01:58:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r53724 r53760 393 393 $response = rest_ensure_response( $data ); 394 394 395 $links = $this->prepare_links( $post->ID ); 396 $response->add_links( $links ); 397 if ( ! empty( $links['self']['href'] ) ) { 398 $actions = $this->get_available_actions(); 399 $self = $links['self']['href']; 400 foreach ( $actions as $rel ) { 401 $response->add_link( $rel, $self ); 395 if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { 396 $links = $this->prepare_links( $post->ID ); 397 $response->add_links( $links ); 398 if ( ! empty( $links['self']['href'] ) ) { 399 $actions = $this->get_available_actions(); 400 $self = $links['self']['href']; 401 foreach ( $actions as $rel ) { 402 $response->add_link( $rel, $self ); 403 } 402 404 } 403 405 } … … 591 593 $response = rest_ensure_response( $data ); 592 594 593 $links = array( 594 'self' => array( 595 'href' => rest_url( sprintf( '%s/%s/themes/%s', $this->namespace, $this->rest_base, $request['stylesheet'] ) ), 596 ), 597 ); 598 599 $response->add_links( $links ); 595 if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { 596 $links = array( 597 'self' => array( 598 'href' => rest_url( sprintf( '%s/%s/themes/%s', $this->namespace, $this->rest_base, $request['stylesheet'] ) ), 599 ), 600 ); 601 $response->add_links( $links ); 602 } 600 603 601 604 return $response;
Note: See TracChangeset
for help on using the changeset viewer.