Conversation
With no pages chosen, the Image Services and Recent Work widgets passed an empty array as post__in. WP_Query treats that as no filter, so with posts_per_page set to -1 the widget printed every published page, including Cart, Checkout and My account. Image Services now renders nothing when no page is selected. Recent Work keeps its title and text and simply lists no pages. Widgets with at least one page selected are unchanged. Verified live: an unconfigured Image Services widget listed all five pages before and rendered nothing after; an unconfigured Recent Work with a title kept the title and text and went from five pages to none; with one page selected both still render that page.
QA suite — refused, no regression specThis PR changes product source but adds no spec, so the suite was Source files changed with no matching spec |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed changes address the empty-selection behavior without unresolved issues.
Review effort: Lite
Findings: None
What changed in this PR
Fixes Image Services and Recent Work widgets displaying every page when no page is selected.
Changes:
- Suppresses Image Services output for empty selections.
- Prevents Recent Work from querying unfiltered pages while preserving title and description.
| File | Description |
|---|---|
inc/widgets/accelerate-recent-work-widget.php |
Prevents unfiltered queries for empty selections. |
inc/widgets/accelerate-image-service-widget.php |
Skips rendering when no pages are selected. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes themegrill/accelerate-pro#55
Changes proposed in this Pull Request:
An Image Services or Recent Work widget with no pages selected listed every published page, including Cart, Checkout and My account. Both widgets drop empty selections and pass what is left as
post__in; with nothing selected that is an empty array, whichWP_Querytreats as no filter, andposts_per_page => -1then returns every page. Image Services now renders nothing when no page is selected, returning before the widget wrapper is printed (so there is no stray empty wrapper). Recent Work has an optional title and description above the pages, so it keeps those and just matches no pages. Widgets with at least one page selected are unchanged. Pro Image Services was not affected (it passes empty strings, which match nothing), and the Pro Recent Work fix is in the matching accelerate-pro PR.Verified live by rendering the real widgets with nothing selected: Image Services went from listing all five pages to rendering nothing; Recent Work with a title and description went from five pages to none while keeping the title and text; with one page selected both still render that page.
How to test the changes in this Pull Request:
Types of changes:
Other information:
Changelog entry
Fix - Image Services and Recent Work widgets no longer list every page when none is selected.