[wp-trac] [WordPress Trac] #39696: REST API: Filter which links get embedded when passing the ?_embed query parameter

WordPress Trac noreply at wordpress.org
Sat Jan 28 02:01:43 UTC 2017


#39696: REST API: Filter which links get embedded when passing the ?_embed query
parameter
-------------------------------------------------+-------------------------
 Reporter:  rheinardkorf                         |       Owner:
     Type:  enhancement                          |  adamsilverstein
 Priority:  normal                               |      Status:  assigned
Component:  REST API                             |   Milestone:  Awaiting
 Severity:  normal                               |  Review
 Keywords:  2nd-opinion needs-refresh needs-     |     Version:  4.7.1
  unit-tests                                     |  Resolution:
                                                 |     Focuses:  rest-api
-------------------------------------------------+-------------------------

Comment (by rheinardkorf):

 @jnylen0 I now have some code that will cater for the scenarios you
 described.

 @adamsilverstein writing the unit tests to test `_embed` is proving to be
 difficult because of the use of $_GET. I don't see anywhere in the unit
 tests where any testing for `_embed` is done at all.  As I started writing
 some unit tests I realised that there may actually be some logical issue
 with class-wp-rest-server.php itself.  This would not be an issue if the
 $request object from `::serve_request()` were to either be 1) set to an
 object property or 2) passed to `::response_to_data()` (and subsequently
 passed to `::embed_links`).  The `_embed` variable can then be pulled from
 $request->get_query_params() and we can thus avoid using $_GET altogether.

 Some direction here would be appreciated :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39696#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list