[wp-trac] [WordPress Trac] #37020: get_rest_url() returns wrong path if the site and home url's are different

WordPress Trac noreply at wordpress.org
Fri Jun 3 19:33:45 UTC 2016


#37020: get_rest_url() returns wrong path if the site and home url's are different
--------------------------+----------------------
 Reporter:  adamf321      |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  REST API      |     Version:  trunk
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by rachelbaker):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 @adamf321 Howdy, and thanks for the ticket.  The REST API endpoints use
 `home_url()` by design for a few reasons:
 1. some endpoint data is publicly discoverable so the public facing url
 (aka home_url) is a better fit
 2. we use rewrites to route endpoint requests and guarantee being able to
 rewrite the `site_url()`

 See: https://github.com/WP-API/WP-API/issues/259

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


More information about the wp-trac mailing list