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 Dec 16, 2022. It is now read-only.
Ensuring that the posts returned from a WP_Query accurately reflect the previewed post changes is a big deficiency in the plugin currently. The current logic to handle this looks at the query vars and then injects additional ID IN (…) and ID NOT IN (…) conditions to the WHERE clause. See WP_Customize_Posts_Preview::filter_posts_where_to_include_previewed_posts() which applies on the posts_where filter. That method currently has a todo:
There are undoubtedly hundreds of possible conditions that are not being accounted for in regards to all of the possible query vars a WP_Query can take.
There is also the problem of making sure that newly-created customized posts (which have an underlying auto-draft state and which have 0000-00-00 as the date) appear in the proper order (the logic in \WP_Customize_Posts_Preview::filter_the_posts_to_preview_settings() is insufficient because it is not aware of pagination).
Ensuring that the posts returned from a
WP_Query
accurately reflect the previewed post changes is a big deficiency in the plugin currently. The current logic to handle this looks at the query vars and then injects additionalID IN (…)
andID NOT IN (…)
conditions to theWHERE
clause. SeeWP_Customize_Posts_Preview::filter_posts_where_to_include_previewed_posts()
which applies on theposts_where
filter. That method currently has a todo:There is also the problem of making sure that newly-created customized posts (which have an underlying
auto-draft
state and which have0000-00-00
as the date) appear in the proper order (the logic in\WP_Customize_Posts_Preview::filter_the_posts_to_preview_settings()
is insufficient because it is not aware of pagination).I've been thinking that what we basically have to replicate the logic in
WP_Query
to augment the query results as required to accurately preview changes. Search indexes commonly intercept the query vars and add filters to get the results from another source and inject them via filteringthe_posts
. See https://github.com/10up/ElasticPress/blob/develop/classes/class-ep-wp-query-integration.phpIn WP 4.6 there is a new option and that is the new
posts_pre_query
filter in 4.6. (See ticket #36687.)The text was updated successfully, but these errors were encountered: