diff --git src/wp-includes/rest-api/class-wp-rest-server.php src/wp-includes/rest-api/class-wp-rest-server.php
index ec8d2a0..f989194 100644
|
|
class WP_REST_Server { |
544 | 544 | |
545 | 545 | $embedded = array(); |
546 | 546 | |
| 547 | // Get link relationships to filter on. |
| 548 | $_embed = isset( $_GET['_embed'] ) ? array_filter( explode( ',', $_GET['_embed'] ) ) : false; |
| 549 | $filtered_rels = empty( $_embed ) ? false : $_embed; |
| 550 | |
547 | 551 | foreach ( $data['_links'] as $rel => $links ) { |
548 | 552 | // Ignore links to self, for obvious reasons. |
549 | 553 | if ( 'self' === $rel ) { |
550 | 554 | continue; |
551 | 555 | } |
552 | 556 | |
| 557 | // If filtered rels are specified and current $rel is not in the list, then continue. |
| 558 | if ( false !== $filtered_rels && ! in_array( $rel, $filtered_rels, true ) ) { |
| 559 | continue; |
| 560 | } |
| 561 | |
553 | 562 | $embeds = array(); |
554 | 563 | |
555 | 564 | foreach ( $links as $item ) { |