Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Improve meta query support #191

Merged
merged 7 commits into from
Jun 30, 2016

Conversation

PatelUtkarsh
Copy link
Member

@PatelUtkarsh PatelUtkarsh commented Jun 28, 2016

Add IN Meta query compare support.

Using $publish flag to filter out posts which do not match meta query.

Add filter customize_previewed_posts_for_query for filtering previewed posts.

@PatelUtkarsh
Copy link
Member Author

PatelUtkarsh commented Jun 28, 2016

I will update test cases.

@PatelUtkarsh
Copy link
Member Author

The last $query_post_where_actual_meta_and_snapshot_with_zero assertion usecase was failing in previous code.

Where it was including value of SQL data which was already changed in preview. So, I use $publish flag to exclude it.

* @type bool $publish IN query or NOT IN query.
* }
*/
$post_ids = apply_filters( 'customize_previewed_posts', $post_ids, array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be customize_previewed_posts_for_query or something a bit more specific than customize_previewed_posts if we add a filter here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PatelUtkarsh And to be clear, the reason why we need a filter is because get_previewed_posts_for_query doesn't support all query vars, correct? If Customize Posts properly understood all query vars, then there shouldn't be a need for a new filter, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, correct.
I will change filter name to customize_previewed_posts_for_query

@westonruter westonruter merged commit 74ddaa9 into feature/meta-queries Jun 30, 2016
@westonruter westonruter deleted the feature/meta-queries-update branch June 30, 2016 20:51
@westonruter westonruter added this to the 0.7 milestone Jul 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants