Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(WPLoader) read content locations from config #750

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Conversation

lucatume
Copy link
Owner

Fixes #745

When possible, read content, plugins and mu-plugins directories location from the WPLoader module configuration.
Respectively, in order:

  • content dir from configuration WP_CONTENT_DIR parameter, then from the installation
  • plugins dir from configuration WP_PLUGIN_DIR parameter, then from the WP_CONTENT_DIR parameter, then from the installation.
  • mu-plugins dir from configuration WPMU_PLUGIN_DIR parameter, then from the WP_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 and WPMU_PLUGIN_DIR constants in their wp-config.php file; in that case the module will throw an exception.

@lucatume lucatume self-assigned this Aug 23, 2024
@lucatume lucatume force-pushed the v4-fix-745 branch 5 times, most recently from 1f8b901 to e5a6106 Compare August 23, 2024 15:14
@lucatume lucatume marked this pull request as ready for review August 24, 2024 08:58
@lucatume lucatume merged commit c738cfa into master Aug 24, 2024
51 checks passed
@lucatume lucatume deleted the v4-fix-745 branch August 24, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Scaffolded::getContentDir() should respect WP_CONTENT_DIR constant
1 participant