WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/24/2016 04:19:44 AM (6 years ago)
Author:
rmccue
Message:

REST API: Use WP_REST_Request::from_url() when embedding.

See #35803.

File:
1 edited

Legend:

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

    r36535 r36674  
    493493
    494494        $response = new WP_REST_Response();
    495         $response->add_link( 'alternate', rest_url( '/test/embeddable?parsed_params=yes' ), array( 'embeddable' => true ) );
     495        $url = rest_url( '/test/embeddable' );
     496        $url = add_query_arg( 'parsed_params', 'yes', $url );
     497        $response->add_link( 'alternate', $url, array( 'embeddable' => true ) );
    496498
    497499        $data = $this->server->response_to_data( $response, true );
     
    515517
    516518        $response = new WP_REST_Response();
    517         $response->add_link( 'up', rest_url( '/test/embeddable?error=1' ), array( 'embeddable' => true ) );
     519        $url = rest_url( '/test/embeddable' );
     520        $url = add_query_arg( 'error', '1', $url );
     521        $response->add_link( 'up', $url, array( 'embeddable' => true ) );
    518522
    519523        $data = $this->server->response_to_data( $response, true );
Note: See TracChangeset for help on using the changeset viewer.