Created
January 9, 2018 00:18
-
-
Save djrmom/a24c01e473673376e1af2ea18d39ae65 to your computer and use it in GitHub Desktop.
facetwp auto-check facet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function fwp_update_facets() { | |
| ?> | |
| <script> | |
| (function($) { | |
| $(document).on('facetwp-loaded', function() { | |
| if ( 'trainings-finden' == FWP_HTTP.uri ) { | |
| if ( FWP.facets['standort'].indexOf("aarau") > -1 && ! ( FWP.facets['standort'].indexOf("flexibel") > -1 ) ) { | |
| FWP.is_reset = true; | |
| FWP.facets['standort'].push("flexibel"); | |
| FWP.refresh(); | |
| } | |
| } | |
| }); | |
| })(jQuery); | |
| </script> | |
| <?php | |
| } | |
| add_action( 'wp_head', 'fwp_update_facets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment