Skip to content

Honor explicit empty search terms and unbounded result sets - #5

Merged
fgirolami29 merged 4 commits into
mainfrom
fix/explicit-empty-term-and-unbounded-results
Oct 2, 2026
Merged

fgirolami29 merged 4 commits into
mainfrom
fix/explicit-empty-term-and-unbounded-results

Conversation

@fgirolami29

Copy link
Copy Markdown
Contributor

Fixes two resolver semantics required by consumers that intentionally switch from full-text search to a complete CPT browse.

Before

  • search_term => '' silently fell back to the current WordPress search term, so podcast stayed a text search.
  • posts_per_page => -1 was normalized back to 10.

After

  • if search_term is explicitly present, its value is respected even when empty;
  • posts_per_page => -1 preserves WordPress's unbounded query contract and sets nopaging=true;
  • if search_term is omitted entirely, request fallback behavior remains unchanged.

This lets integrations intentionally do:

[
    'search_term'    => '',
    'post_types'     => ['podcast'],
    'posts_per_page' => -1,
]

and receive the complete published Podcast collection instead of a relevance search for the word "podcast".

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@fgirolami29
fgirolami29 merged commit 453e75e into main Oct 2, 2026
1 check passed
@fgirolami29
fgirolami29 deleted the fix/explicit-empty-term-and-unbounded-results branch October 2, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant