[wp-trac] [WordPress Trac] #40521: Using a custom query var on a static front page results in wrong $post
WordPress Trac
noreply at wordpress.org
Thu Sep 18 13:29:06 UTC 2025
#40521: Using a custom query var on a static front page results in wrong $post
---------------------------------------+-----------------------------
Reporter: mechter | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Query | Version: 4.7.4
Severity: normal | Resolution:
Keywords: needs-patch has-test-info | Focuses:
---------------------------------------+-----------------------------
Changes (by SirLouen):
* keywords: => needs-patch has-test-info
* component: Posts, Post Types => Query
* milestone: Awaiting Review => Future Release
Comment:
== Reproduction Report
=== Description
✅ This report validates that the issue can be reproduced.
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.1
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 139.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
* BBB Testing Dolly
* Test Reports 1.2.0
=== Instructions
1. The ones provided by OP.
=== Actual Results
1. ✅ Error condition occurs (reproduced).
=== Additional Notes
- There is something weird around this line
https://github.com/wordpress/wordpress-
develop/blob/9ca38ce47b7a8a9c9e916e6aff39ec772ccbba55/src/wp-includes
/class-wp-query.php#L1057
That `array_diff` is not correctly formulated, as the result unexpectedly
is this `buggy` query var. I'm assuming that the idea is, that if any of
those query vars existed, not to show the front page, but the
corresponding search page. A patch is needed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40521#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list