Skip to content

Fix warning for case of non-existing 'post_type' key in query vars#231

Open
econscript wants to merge 2 commits intodevelopfrom
fix/post-type-warning-on-queries
Open

Fix warning for case of non-existing 'post_type' key in query vars#231
econscript wants to merge 2 commits intodevelopfrom
fix/post-type-warning-on-queries

Conversation

@econscript
Copy link
Copy Markdown

@econscript econscript commented Mar 18, 2026

Description

This pulls a fix made upstream: 10up#4105

Silences a noisy Undefined array key "post_type" PHP warning whenever a query is made without the post_type parameter in the query_vars array.

Checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally (or has an appropriate fallback).
  • This change works and has been tested on a Go sandbox.
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • This change has the fix PRed upstream (if applicable). If not applicable, it has the relevant "// VIP: reason for the discrepancy with upstream" comment in places where the code is discrepant.

Steps to Test

@econscript econscript requested a review from a team March 18, 2026 04:11
@econscript
Copy link
Copy Markdown
Author

econscript commented Mar 18, 2026

I had to pull in this upstream commit to fix the Unit tests: 10up#2984
This changes the ordering to post__in from the default date (post_date) apparently this is an intermittent test failure.

The rest of this method was updated in this PR: https://github.com/Automattic/ElasticPress/pull/228/changes

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.

1 participant