You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
When setting up the WP_Query object in Components_Endpoint::build_query(), the is_home flag is not being set correctly because internally, when WP_Query::parse_query() sets those flags, it explicitly includes a condition that the current request is not a REST request.
Since we are always setting up the WP_Query object in the context of a REST request, this will always be false. Annoyingly, the is_home flag is also then used in the logic to set up several other flags, which are now unreliable as well.
Our two options are to either manually set the is_home flag using the same basic logic as WordPress on the parse_query action and then rerun parse_query_vars() to fix inconsistencies, or we need to fork all of the logic that relies on the is_home flag and fix them all manually.
The text was updated successfully, but these errors were encountered:
Went dumpster diving through Trac and found this issue as the reason why WordPress decided to explicitly set is_home to false during REST requests: https://core.trac.wordpress.org/ticket/34373
When setting up the
WP_Query
object inComponents_Endpoint::build_query()
, theis_home
flag is not being set correctly because internally, whenWP_Query::parse_query()
sets those flags, it explicitly includes a condition that the current request is not a REST request.Since we are always setting up the
WP_Query
object in the context of a REST request, this will always be false. Annoyingly, theis_home
flag is also then used in the logic to set up several other flags, which are now unreliable as well.Our two options are to either manually set the
is_home
flag using the same basic logic as WordPress on theparse_query
action and then rerunparse_query_vars()
to fix inconsistencies, or we need to fork all of the logic that relies on theis_home
flag and fix them all manually.The text was updated successfully, but these errors were encountered: