[wp-trac] [WordPress Trac] #13550: WP_PLUGIN_DIR doesn't detect symlinks
WordPress Trac
wp-trac at lists.automattic.com
Wed May 26 13:08:51 UTC 2010
#13550: WP_PLUGIN_DIR doesn't detect symlinks
---------------------------+------------------------------------------------
Reporter: acumensystems | Owner: westi
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Plugins | Version: 3.0
Severity: minor | Keywords: symlink plugin basename paths
---------------------------+------------------------------------------------
Hi
I've noticed a number of plugins hardcoding their plugin directories, and
I think I see why. If you develop a theme, and that theme depends on
plugins, it's tempting to bundle the plugins along with the theme files
(i.e. all in wp-content/themes/mytheme).
Then, to allow Wordpress to use these plugins, it's common to symlink wp-
content/plugins to wp-content/themes/mytheme/plugins, or somesuch.
That means that plugins using plugin_basename(__FILE__) will break, as the
WP_PLUGIN_DIR path will not be removed from the full returned path.
I've written a patch for wp-includes/default-constants.php that will
detect if the plugins directory is a symlink, and if so will use the
appropriate correct path as part of the constant, thereby ensuring all
paths calculated by plugins are correct based on this constant.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13550>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list