Add ability to use filters in Extension Customizer #3285
Closed
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.
Hey Redux team!
I've come across an issue that has been reported before, but a non-BC breaking PR has never been opened. I think this takes care of fixing both my issue, and also not breaking anything for existing Redux users.
The problem:
Users of Bedrock (https://github.com/roots/bedrock) are unable to use the Customizer for themes that take advantage of Redux. This is due to the usage of a non-standard plugins directory location (and I believe a symlink) which causes the required Customizer files (extension_customizer.css and extension_customizer.js) to not load properly, as the _extension_dir and _extension_url variables are incorrect for Bedrock installations.
The solution:
Following the pre-existing pattern of using filters within Redux (I followed the example of the existing redux/_url and redux/_dir filters), I've simply added the ability to define filters to customize these values when necessary. This keeps existing behavior the same for users, and allows developers making use of non-standard WordPress installs to still be able to support Redux in custom configurations without needing to edit the Redux source code.
Related Issues I Referenced:
#2519 and #2754