-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
@weston Added the |
There was a problem hiding this 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.
@@ -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 ); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.