[wp-trac] [WordPress Trac] #26985: Use network_site_url in includes_url (was: Use network_site_url in includes_dir)

WordPress Trac noreply at wordpress.org
Sat Feb 1 18:59:22 UTC 2014


#26985: Use network_site_url in includes_url
--------------------------------+------------------------------
 Reporter:  nofearinc           |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Networks and Sites  |     Version:  3.6
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+------------------------------
Description changed by jeremyfelt:

Old description:

> The `includes_dir` function is used in several places for getting the
> path to `wp-includes`. For example, `class-wp-editor.php` is using it to
> get the `$baseurl` variable and load other related scripts (such as
> TinyMCE) accordingly.
>
> On a multisite, `includes_dir` relies on `site_url` which leads to a
> similar path if ran on a subsite in a network:
>
> {{{
> site.com/subsite/wp-includes/...
> }}}
>
> If a server like nginx doesn't have a working rewrite for a given
> version, across the site we could use hooks such as `script_loader_src`
> or `style_loader_src` to work around the problem, and we could also
> filter `includes_url` to set the correct paths (as workarounds). I
> suggest switching to `network_site_url` instead as it fallbacks to
> `site_url` for single sites.

New description:

 The `includes_url` function is used in several places for getting the path
 to `wp-includes`. For example, `class-wp-editor.php` is using it to get
 the `$baseurl` variable and load other related scripts (such as TinyMCE)
 accordingly.

 On a multisite, `includes_url` relies on `site_url` which leads to a
 similar path if ran on a subsite in a network:

 {{{
 site.com/subsite/wp-includes/...
 }}}

 If a server like nginx doesn't have a working rewrite for a given version,
 across the site we could use hooks such as `script_loader_src` or
 `style_loader_src` to work around the problem, and we could also filter
 `includes_url` to set the correct paths (as workarounds). I suggest
 switching to `network_site_url` instead as it fallbacks to `site_url` for
 single sites.

--

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


More information about the wp-trac mailing list