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

Add faustwp_exclude_from_public_redirect filter to companion WordPress plugin #1320

Merged
merged 6 commits into from
Mar 14, 2023

Conversation

josephfusco
Copy link
Member

@josephfusco josephfusco commented Mar 11, 2023

Tasks

Description

These changes are based on the originally proposed solution from #740. Unfortunately that GitHub account is no longer active.

Related Issue(s):

These changes will close #739.

Testing

  1. Create the pages "checkout" & "cart" in WordPress.
  2. Make sure the "Enable public route redirect" setting is active within the Faust WordPress plugin.
  3. Make sure that your front-end URL is using http://localhost:3000
  4. Observe that the WordPress pages /checkout and /cart redirect to their corresponding pages on http://localhost:3000
  5. Add the following snippet to your WordPress site (bottom of the active theme's /functions.php is fine for this)
    add_filter( 'faustwp_exclude_from_public_redirect', function( $excluded ) {
      $excluded = array_merge( $excluded, [
        'checkout',
        'cart',
      ]);
      return $excluded;
    }, 10, 1 );
  6. Observe that the WordPress pages /checkout and /cart DO NOT redirect away from WordPress.

Documentation Changes

Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
@josephfusco josephfusco requested a review from a team as a code owner March 11, 2023 04:46
@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2023

🦋 Changeset detected

Latest commit: 6c5bd72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@faustwp/wordpress-plugin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@atlas-by-wp-engine
Copy link

Check out the recent updates to your Atlas preview environment:

App Environment URL Build
faustjs preview-env-MERL-150 https://hc…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2023

Coverage report for packages/faustwp-core

St.
Category Percentage Covered / Total
🟡 Statements 78.46% 736/938
🔴 Branches 54.09% 370/684
🟢 Functions 82.58% 109/132
🟡 Lines 77.92% 706/906

Test suite run success

101 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from 6c5bd72

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2023

Coverage report for packages/faustwp-cli

St.
Category Percentage Covered / Total
🟢 Statements 100% 0/0
🟢 Branches 100% 0/0
🟢 Functions 100% 0/0
🟢 Lines 100% 0/0

Test suite run success

0 tests passing in 0 suite.

Report generated by 🧪jest coverage report action from 6c5bd72

@atlas-by-wp-engine
Copy link

Check out the recent updates to your Atlas preview environment:

App Environment URL Build
faustjs preview-env-MERL-150 https://hc…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
@josephfusco josephfusco added the package: faustwp Related to the companion WordPress plugin label Mar 11, 2023
@atlas-by-wp-engine
Copy link

Check out the recent updates to your Atlas preview environment:

App Environment URL Build
faustjs preview-env-MERL-150 https://hc…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@josephfusco josephfusco changed the title Add exclude from public redirect filter Add faustwp_exclude_from_public_redirect filter to companion WordPress plugin Mar 11, 2023
Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
@atlas-by-wp-engine
Copy link

Check out the recent updates to your Atlas preview environment:

App Environment URL Build
faustjs preview-env-MERL-150 https://hc…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
Signed-off-by: Joe Fusco <joe.fusco@wpengine.com>
@atlas-by-wp-engine
Copy link

Check out the recent updates to your Atlas preview environment:

App Environment URL Build
faustjs preview-env-MERL-150 https://hc…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Copy link
Member

@theodesp theodesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Maybe we should close this ticket once merged
#739

@josephfusco josephfusco merged commit c4696ef into canary Mar 14, 2023
@josephfusco josephfusco deleted the MERL-150 branch March 14, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: faustwp Related to the companion WordPress plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability for some URLs not to be redirected to headless site
2 participants