mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 22:32:52 +02:00
REST API: Allow queries other than the main query to be is_home
.
Ensure that REST API calls can match the main query of the page. See #34373. Fixes #50213. Props: dlh, TimothyBlynJacobs, boonebgorges, joemcgill, whyisjake. Built from https://develop.svn.wordpress.org/trunk@48053 git-svn-id: http://core.svn.wordpress.org/trunk@47820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ccf534dc48
commit
ea8331f00d
@ -965,7 +965,7 @@ class WP_Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed
|
if ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed
|
||||||
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST && $this->is_main_query() )
|
||||||
|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {
|
|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {
|
||||||
$this->is_home = true;
|
$this->is_home = true;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-48052';
|
$wp_version = '5.5-alpha-48053';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user