Last active
May 11, 2018 05:41
-
-
Save bjorn2404/12245190b8b2b9e20ef2c41c708f2a5c to your computer and use it in GitHub Desktop.
CSL manual front-end filters register example
This file contains 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 | |
/** | |
* Manually add categories for static data. | |
* The property ('category' below) should match the property/attribute name in your JSON or XML data. | |
* The value ('category-filter' below) should match the ID of the HTML container element around the input fields. | |
*/ | |
function bh_sl_manual_categories() { | |
?> | |
<script> | |
jQuery.noConflict(); | |
(function($) { | |
$(function() { | |
var $mapContainer = $('#bh-sl-map-container'); | |
if ($mapContainer.length) { | |
$mapContainer.storeLocator({ | |
'taxonomyFilters': { | |
'category': 'category-filter', | |
'feature' : 'features-filter', | |
'city' : 'city-filter', | |
'postal' : 'postal-filter' | |
} | |
}); | |
} | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'bh_sl_manual_categories' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment