[wp-trac] [WordPress Trac] #13550: WP_PLUGIN_DIR doesn't detect symlinks

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 22 22:21:38 UTC 2011


#13550: WP_PLUGIN_DIR doesn't detect symlinks
---------------------------------+-----------------------------
 Reporter:  acumensystems        |       Owner:  westi
     Type:  enhancement          |      Status:  reopened
 Priority:  normal               |   Milestone:  Future Release
Component:  Plugins              |     Version:  3.0
 Severity:  minor                |  Resolution:
 Keywords:  has-patch 3.2-early  |
---------------------------------+-----------------------------
Changes (by jltallon):

 * cc: jltallon (added)


Comment:

 Some more input on this:

 We normally use the debian-provided package version, which is installed
 (system-wide) at /usr/share/wordpress.

 For each WP installation, we define('WP_CONTENT_DIR','/srv/customer-
 domain/wordpress') or the like, and WP_CONTENT_URL accordingly.
 In order to keep a sane environment, we usually symlink plugins (within
 WP_CONTENT_DIR/plugins) to their sytem-wide location.

 For plugin-provided downloadable files (such as JS or CSS), the best
 solution we have come up with so far is to do:
    $url = plugins_url( basename(dirname(__ FILE __)).'/path/to/file');

 which could be expressed as:
    $url = WP_PLUGIN_URL.plugin_basename(dirname(__ FILE
 __).'/path/to/file'


 This can an issue when __ FILE __'s path is not precisely WP_CONTENT_DIR
 .'/'. <plugin_basename> .'/'. <filename>, since plugin_basename is
 actually a symlink.


 I'm available to provide more input on this.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13550#comment:21>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list