Skip to content

fix: fine-tune code removing patterns to skip Woo Coming Soon patterns#439

Open
laurelfulford wants to merge 2 commits intotrunkfrom
fix/woocommerce-coming-soon
Open

fix: fine-tune code removing patterns to skip Woo Coming Soon patterns#439
laurelfulford wants to merge 2 commits intotrunkfrom
fix/woocommerce-coming-soon

Conversation

@laurelfulford
Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

The Block Theme currently has some code that removes all patterns registered outside of Newspack, to help simplify pattern selection and help focus publishers on what we've bundled.

This has had the unfortunately side-effect of obliterating WooCommerce's 'Coming Soon' page, as the pattern is not available on the front-end 😅

This PR adds a check for those patterns specifically and makes sure they don't get removed. We may want to add our own version of this page in the future, but as is, it does the trick for now.

How to test the changes in this Pull Request:

  1. Ensure WooCommerce is in 'Coming Soon' mode (WooCommerce > Settings > Site Visibility)
  2. In an incognito window, go to your /shop page; note nothing loads.
  3. Apply this PR.
  4. Refresh the incognito window; confirm you get the theme's header and footer, and a coming soon message.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the theme’s pattern-cleanup logic to avoid unregistering WooCommerce “Coming Soon” patterns, which are required for the Coming Soon template to render correctly on the frontend and in the Site Editor.

Changes:

  • Exempts woocommerce/coming-soon* patterns from being unregistered during REST pattern listing (restrict_patterns).
  • Exempts woocommerce/coming-soon* patterns from being unregistered during late init cleanup (remove_registered_patterns).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/class-patterns.php Outdated
Comment thread includes/class-patterns.php Outdated
@laurelfulford laurelfulford marked this pull request as ready for review April 9, 2026 22:55
@laurelfulford laurelfulford requested a review from a team as a code owner April 9, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants