[wp-trac] [WordPress Trac] #27806: Link formatting for Plugins incorrect if defining WP_PLUGIN_URL

WordPress Trac noreply at wordpress.org
Tue Apr 15 21:41:20 UTC 2014


#27806: Link formatting for Plugins incorrect if defining WP_PLUGIN_URL
--------------------------+------------------------------
 Reporter:  mamborambo    |       Owner:  rmccue
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Plugins       |     Version:  2.7
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by mamborambo):

 Yes @jeremyfelt the symlink problem is essentially the same as this issue.
 By design any wordpress installation cannot really be stored separately
 from its plugins, so it is all symlinked under the surface.

 What I have done is to use NGINX to deliver the part of the file system
 containing plugins, since they are called from browser to fetch extra js
 and css for each plugin.

 That is why I define WP_PLUGIN_URL and WP_PLUGIN_DIR constants.
 The rest of WP run through APACHE.

 My solution so far is to modify insert line 2165 of link-template.php

   $folder = str_replace(realpath(WP_PLUGIN_DIR),'','/'.$folder);


 This takes the decoded directory path of the plugin, remove the part
 defined in
 WP_PLUGIN_DIR, and use that to form the URL of the plugin component.

 (The most correct solution is to use WPMU_PLUGIN_DIR if the function
 plugins_url
 is called from a WPMU plugin, and WP_PLUGIN_DIR if called from WP plugin).

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


More information about the wp-trac mailing list