Make WordPress Core


Ignore:
Timestamp:
10/08/2019 04:43:10 AM (5 years ago)
Author:
kadamwhite
Message:

REST API: Permit embedding of the 'self' link relation in the /search endpoint.

Removes a special-case prohibition against embedding 'self' which prevented ?_embed from being used with the /wp/v2/search endpoint.

Props TimothyBlynJacobs, chrisvanpatten, kadamwhite.
Fixes #47684.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php

    r46280 r46434  
    13641364        $this->assertEquals( rest_url( '/wp/v2/posts/' . self::$post_id ), $links['self'][0]['href'] );
    13651365        $this->assertEquals( rest_url( '/wp/v2/posts' ), $links['collection'][0]['href'] );
     1366        $this->assertArrayNotHasKey( 'embeddable', $links['self'][0]['attributes'] );
    13661367
    13671368        $this->assertEquals( rest_url( '/wp/v2/types/' . get_post_type( self::$post_id ) ), $links['about'][0]['href'] );
Note: See TracChangeset for help on using the changeset viewer.