This is basically a php question.
add_filter( 'facetwp_map_marker_args', function( $args, $post_id ) {
$field = get_field( 'Type', $post_id ); // Get this post's ACF value
$tent="tent";
if( !$field ){
$field = $tent;
}
$args['icon'] = 'https://www.muddycamper.com/wp-content/themes/oceanwp-child-theme-muddy-camper/images/markers/' . $field . '.png';
return $args; }, 10, 2 );
You could do it your way as well, but it’s extra coding:
add_filter( 'facetwp_map_marker_args', function( $args, $post_id ) {
$field = get_field( 'Type', $post_id ); // Get this post's ACF value
$tent="tent";
if( $field ){
$value = $field;
} else {
$value = $tent;
}
$args['icon'] = 'https://www.muddycamper.com/wp-content/themes/oceanwp-child-theme-muddy-camper/images/markers/' . $value . '.png';
return $args; }, 10, 2 );