[wp-trac] [WordPress Trac] #34358: plugin_dir_url( __FILE__ ) returns plugins directory when plugin symlinked to mu-plugins

WordPress Trac noreply at wordpress.org
Mon Oct 19 22:00:51 UTC 2015


#34358: plugin_dir_url( __FILE__ ) returns plugins directory when plugin symlinked
to mu-plugins
----------------------------+------------------------------
 Reporter:  scamartist26    |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  4.3.1
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by scamartist26):

 Here is the current setup.

 /mu-plugins/myplugin
 /mu-plugins/myplugin2
 /mu-plugins/myplugin3
 /mu-plugins/myplugin_symlinked
 /mu-plugins/all_plugins_loader.php

 `all_plugins_loader.php` has the includes for all main
 `/myplugin/myplugin.php` files as noted here: [ticket:16953#comment:120].
 The `myplugin_symlinked` works fine to run the application ''other than
 any calls using'' `plugins_url()` or `plugin_dir_url()`. Those functions
 do not use the same catch that is in the `plugin_basename()` for the
 `$realdir` variable here:
 https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-
 includes/plugin.php#L656. Therefore it defaults to the `plugins`
 directory.

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


More information about the wp-trac mailing list