feat[core]: (#739) allow plugins to filter out pages from public url redirect #740
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.
Offer the option to exclude specific pages from redirect should a developer have a need to do this.
Description
The WordPress plugin offers the option to redirect all or none of the pages to the headless site URI. There may be cases where a developer would want some exceptions to this all or nothing approach. For instance if someone is using WooCommerce and wants to use the WooCommerce checkout page without having to rewrite all the logic in the headless site.
Related Issue(s):
Testing
I added the following filter to a custom plugin I built after modifying callbacks.php to include this filter.
This successfully prevented redirecting from https://mywordpresssite.com/shop/ to http://localhost:3000/shop. I tested other URLs such as https://mywordpresssite.com/alligator/ and that DID redirect correctly.