feat(WPLoader) read content locations from config #750
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #745
When possible, read content, plugins and mu-plugins directories location from the
WPLoader
module configuration.Respectively, in order:
WP_CONTENT_DIR
parameter, then from the installationWP_PLUGIN_DIR
parameter, then from theWP_CONTENT_DIR
parameter, then from the installation.WPMU_PLUGIN_DIR
parameter, then from theWP_CONTENT_DIR
parameter, then from the installation.The following methods, used internally by the
WPLoader
module are affected:getPluginsFolder
getMuPluginsFolder
getContentFolder
The methods will now take configuration parameters into account allowing a test override of the default location.
The PR will not, and cannot, deal with WordPress installations defining the
WP_CONTENT_DIR
,WP_PLUGIN_DIR
andWPMU_PLUGIN_DIR
constants in theirwp-config.php
file; in that case the module will throw an exception.