Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding additional query vars #25

Merged
merged 7 commits into from
Oct 6, 2016

Conversation

miina
Copy link
Contributor

@miina miina commented Oct 5, 2016

No description provided.

@miina
Copy link
Contributor Author

miina commented Oct 5, 2016

@weston Added the reference_post_id to allowed post query vars. Let me know if there's anything to change, otherwise that should be ready for merging.

Copy link
Contributor

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

I don't think this plugin needs to know about this specific query var. There should be a filter applied which allows additional query vars and maybe sanitizes them as well.

@miina miina changed the title Add reference_post_id to allowed query vars Allow adding additional query vars Oct 5, 2016
@@ -291,6 +291,8 @@ public function process_post_query_vars( $post_query_vars ) {
'order',
);

$allowed_query_vars = apply_filters( 'customize_object_selector_query_posts_allowed_vars', $allowed_query_vars );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should throw an error in case this returns null since then all the vars would be allowed. Or maybe in case of null we should set it to array() which will throw an error with $extra_query_vars. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

@miina there's no need for this customize_object_selector_query_posts_allowed_vars filter now because the opt-in will instead be accounted for below in the customize_object_selector_post_query_vars filter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

💡 Of course not, doh. Will remove.

@westonruter westonruter merged commit 17c0559 into develop Oct 6, 2016
@westonruter westonruter deleted the feature/allow-reference-post-id branch October 6, 2016 23:21
@westonruter westonruter added this to the 0.4.0 milestone Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants