Skip to content

Fix: Disable post cache for cross-site queries - #4353

Open
burhandodhy wants to merge 2 commits into
developfrom
fix/4352
Open

Fix: Disable post cache for cross-site queries#4353
burhandodhy wants to merge 2 commits into
developfrom
fix/4352

Conversation

@burhandodhy

Copy link
Copy Markdown
Contributor

Description of the Change

On multisite, cross-site Elasticsearch queries (site__in, site__not_in, or ep_search_scopeall) could prime the blog-specific posts cache with posts from other sites. Because that cache is keyed by post ID only, a later get_post() for a local ID could return another site's content.

This change disables cache_results for those cross-site query scopes in get_es_posts(), after the final scope is resolved.

Closes #4352

How to test the Change

Changelog Entry

Changed - Set cache_results to false if the query args contain site__in or site__not_in, or if ep_search_scope is set to all.

Credits

Props @burhandodhy @dannyreaktiv

Checklist:

@burhandodhy burhandodhy added this to the 5.3.4 milestone Aug 11, 2026
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.

BUG: FSE template-parts replaced in Multisite searches

1 participant