Closed bueltge closed 8 years ago
Yes, please.
The best case scenario is for the include path to allow placement in plugins, mu-plugins, or any other custom directory.
This isn't possible unless the main plugin that provides the admin UI is active, since there's no other code executed to announce its location. The drop-ins themselves don't have a way to know, and filters aren't available as early as advanced-cache.php is loaded.
Perhaps custom constants might work, and if they're defined they'll be blindly used instead? I usually shy away from these types of unchecked settings, but I have a hunch it's the most flexible way.
I've taken a deeper look, and I don't think these changes will work.
wp_plugin_directory_constants()
is called after advanced-cache.php
is included, meaning if WP_PLUGIN_DIR
is not explicitly defined in wp-config.php
or earlier, these drop-ins cannot be located.
Another approach was taken in e6742c5, where we check if the constant is defined, and if it is not, we define it (pretty early) and use it.
This should cover all scenarios, while also remaining flexible. I'm comfortable closing this issue since the root suggestion is resolved. Feel free to reopen or create a new issue if you feel otherwise.
Thanks for everything here everyone!
The approach works fine me, all is good. Leave close the ticket. Best.
The Drop-ins use the constant
WP_CONTENT_DIR
, likerequire_once WP_CONTENT_DIR . '/plugins/wp...
inadvanced-cache.php
. WordPress allow, that the install define a custom path to the plugin directory, viaWP_PLUGIN_DIR
andWP_PLUGIN_URL
likeThe plugin should also allow this (usage from
WP_PLUGIN_DIR
), that users with a defined plugin directory can use the nice plugin.Maybe also a pull request, if you like?