#16199 closed defect (bug) (worksforme)
plugin_dir_url - wrong directory for symlinks
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | 3.0.4 |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
If plugin dir is a symlink, plugin_dir_url generate wrong url, getting physical not logical path.
I have symlink in wp-content/plugins
ln -s /home/user/svn/wordpress/plugins/plugin_dir/trunk plugin_dir
returns:
http://wordpress/wp-content/plugins/home/user/svn/wordpress/plugins/plugin_dir/trunk/
instead:
http://wordpress/wp-content/plugins/plugin_dir/
Change History (3)
Note: See
TracTickets for help on using
tickets.
plugin_dir_url()
lets you specify a$file
parameter. If you pass in__FILE__
, the symlink will always be resolved.Instead of passing in
__FILE__
, you can use$_SERVER["SCRIPT_FILENAME"]
, which will let the symlink alone.See this StackOverflow Q/A.
Also, you can even move your wp-content folder somewhere else, although this is not completely compatible with multisite enabled (works fine for single site). In your
wp-config.php
file, you can define these constants:I'm closing this as worksforme.