Skip to content

Instantly share code, notes, and snippets.

@bjorn2404
Last active May 11, 2018 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjorn2404/12245190b8b2b9e20ef2c41c708f2a5c to your computer and use it in GitHub Desktop.
Save bjorn2404/12245190b8b2b9e20ef2c41c708f2a5c to your computer and use it in GitHub Desktop.
CSL manual front-end filters register example
<?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