Skip to content

Instantly share code, notes, and snippets.

@ProjectKarol
Forked from mgibbs189/functions.php
Created December 9, 2018 17:18
Map facet - dynamic icon based on an ACF field
<?php
add_filter( 'facetwp_map_marker_args', function( $args, $post_id ) {
$field = get_field( 'type_opport', $post_id ); // Get this post's ACF value
$icon = $field[0]; // get the first value (assuming this is an array)
$args['icon'] = 'https://URL/TO/' . $icon . '.png';
return $args;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment