[wp-trac] [WordPress Trac] #35287: get_site_url does not accept path parameter

WordPress Trac noreply at wordpress.org
Sat Jan 2 14:35:42 UTC 2016


#35287: get_site_url does not accept path parameter
--------------------------+----------------------
 Reporter:  WebDevDLo     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by swissspidy):

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


Comment:

 Please have a look at the
 [https://developer.wordpress.org/reference/functions/get_site_url/
 documentation for get_site_url()]. The function takes `$blog_id` as the
 first parameter, and `$path` as the ''second''.

 So your code should probably look like `get_site_url( null, '/some-path'
 );` — or just `site_url( '/some-path' );`. `site_url()` is just a wrapper
 for `get_site_url()`, always passing `$blog_id = null`

 The same goes for `get_home_url()` and `home_url()`.

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


More information about the wp-trac mailing list