-
Notifications
You must be signed in to change notification settings - Fork 314
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 facet widget customization. #1160
Allow facet widget customization. #1160
Conversation
Hi @allan23 , I removed the facet template and stored the html in a variable as we discussed. Let me know if I catched this right. Thank you! |
@@ -229,6 +231,8 @@ public function widget( $args, $instance ) { | |||
</div> | |||
</div> | |||
<?php | |||
$facet_html = ob_get_clean(); | |||
echo apply_filters( 'ep_facet_search_widget', $facet_html ); |
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.
Let's pass along some data (selected filters, current facets, etc.).
Ideally, we want a developer to either be able to modify the existing HTML or replace it completely with their own.
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 passed $selected_filters, $terms_by_slug, $outputted_terms to the filter, so they can build upon those :)
includes/facet-frontend-template.php
Outdated
@@ -0,0 +1,124 @@ | |||
<?php |
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.
Is this file still needed?
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.
This file was deleted. Thanks :)
Hi @allan23 , Thanks! I addressed this in a new commit. I'm passing |
* Revert "Remove weighting by date (#940)" This reverts commit f8efd8d. * Revert "Allow facet query string customization. (#1198) (#1208)" This reverts commit c30a95e. * Revert "Correct a comment. (#1172)" This reverts commit 5336413. * Revert "Hide prefix trailing dash on settings page (#1204)" This reverts commit 2adc740. * Revert "WIP Sticky posts feature. (#1164)" This reverts commit 917d02b. * Revert "ep_indexable_blogs filter (#1209)" This reverts commit 4cba515. * Revert "Fix postType being set to 'publish' instead of postStatus. (#1173)" This reverts commit a253dc3. * Revert "Allow facet widget customization. (#1160)" This reverts commit b2f77c7. * Revert "Filter prefiltered post_types when protected content feature enabled. (#1135)" This reverts commit 8b86bb4. * Revert "Use wildcard query with compare like. (#1167)" This reverts commit bde2c18.
Hi @allan23 ,
Could you use this PR which addresses #1068 ?
This PR uses
include_once()
to include the html output that was previously being displayed as part ofpublic function widget()
, and by adding a new filefacet-frontend-template.php
to the includes folder.This enables users to replace the default template with one of their choice as noted in #1068 by adding a new filter to replace the template path
Thanks!