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

gpeb-filter-with-default-value.php: Added snippet to load Entries Block with a provided default value on a filter. #807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saifsultanc
Copy link
Contributor

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2565332084/64616?folderId=3808239

Summary

Setup default value for a filter in the Filters block.

Applied the wp_safe_redirect logic as on core we do when we manually "apply" a filter (here)

…lock with a provided default value on a filter.
Copy link
Contributor

@claygriffiths claygriffiths left a comment

Choose a reason for hiding this comment

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

I like the scrappiness of a redirect here, but it's pretty jank.

My inclination is to introduce a new method in GPEB that handles rgget( 'filters' ) and wraps it with a filter hook.

https://github.com/gravitywiz/gp-entry-blocks/blob/master/includes/class-gf-queryer.php#L363

You'll also likely want to update any $_GET['filters'] in class-filters.php for the block itself so the Filters form is populated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants