mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 13:14:29 +00:00
Better default values in WP_Query::get_queried_object().
Setting the default value of the `queried_object_id` property to `0` meant that, when called early enough in the WP bootstrap, `get_queried_object()` could short-circuit the normal query by fooling it into thinking that the request was for a page with id 0. Setting the default value to `null` instead avoids this problem. Props gradyetc, jazbek. Fixes #31355. git-svn-id: https://develop.svn.wordpress.org/trunk@34073 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3926,7 +3926,7 @@ class WP_Query {
|
||||
return $this->queried_object;
|
||||
|
||||
$this->queried_object = null;
|
||||
$this->queried_object_id = 0;
|
||||
$this->queried_object_id = null;
|
||||
|
||||
if ( $this->is_category || $this->is_tag || $this->is_tax ) {
|
||||
if ( $this->is_category ) {
|
||||
|
||||
Reference in New Issue
Block a user