Locateandfilter_pro on Version: 1.5.43.acf included ACF filters.
Now you can use Advanced Custom Fields for filters
such types as Number, Select, Checkbox, True / False, Radio Button
see demo https://demo-top.locateandfilter.com/demo-map-acf-filters/
How to use
eg your ACF
for activate you need enable ‘Enable ACF for filters’ option on Map settings
after save settings plugin start parsing all ACF (only supported type) for your post type
eg
for map filters you can use selector same type such as acf or any other
eg
number type set like range
multi Select set like Select Multiple (AND logic)
checkbox set like Checkboxes
True / False set like Checkboxes (it will be automatically converted into one checkbox)
Radio Button resp. set like Radio buttons
if you use ACF tag on Navlist Templates and Tooltip template
and ACF filed type Select or Checkbox
these tags will only return values and not names, labes
to get user friendly values for these fields you can add a new custom tag to your theme
eg for ACF Servises (key field_648afce57119e)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Locate_And_Filter_Addon_Helper::define_custom_tags( array( 'field_648afce57119e' =>'field_648afce57119e'), 'all', getDataCallbackFn_field_648afce57119e_tags, 'field_648afce57119e' ); function getDataCallbackFn_field_648afce57119e_tags( $field, $id){ $html = ''; ob_start(); $acf_filed = get_field_object($field, $id); echo "<div class='custom_tag_acf ".$field."'>"; foreach ($acf_filed["value"] as $key => $value) { echo "<span>".$acf_filed["choices"][$value]."</span>"; } echo "</div>"; $html .= ob_get_contents(); ob_end_clean(); return $html; } |