Skip to content

Allow adding additional query vars#25

Merged
westonruter merged 7 commits into
developfrom
feature/allow-reference-post-id
Oct 6, 2016
Merged

Allow adding additional query vars#25
westonruter merged 7 commits into
developfrom
feature/allow-reference-post-id

Conversation

@miina

@miina miina commented Oct 5, 2016

Copy link
Copy Markdown
Contributor

No description provided.

@miina

miina commented Oct 5, 2016

Copy link
Copy Markdown
Contributor Author

@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.

@westonruter westonruter left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread php/class-plugin.php Outdated
'order',
);

$allowed_query_vars = apply_filters( 'customize_object_selector_query_posts_allowed_vars', $allowed_query_vars );

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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