Skip to content

Instantly share code, notes, and snippets.

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 hawkidoki/c17b7ca836132d479e6f0f9b5ca66f62 to your computer and use it in GitHub Desktop.
Save hawkidoki/c17b7ca836132d479e6f0f9b5ca66f62 to your computer and use it in GitHub Desktop.
<?php
function hwk_acf_map_icon($options){
if(!isset($options['value']['hwk_google_map_icon']) || empty($options['value']['hwk_google_map_icon']))
return;
echo ' data-icon=\'' . $options['value']['hwk_google_map_icon'] . '\'';
}
function hwk_acf_map_atts($options, $mode = false){
$atts = array();
if($options['hwk_google_map_option_zoom'] == '1' && isset($options['value']['hwk_google_map_zoom']) && !empty($options['value']['hwk_google_map_zoom']))
$atts['data-zoom'] = $options['value']['hwk_google_map_zoom'];
if($options['hwk_google_map_option_style_user'] == '1' && isset($options['value']['hwk_google_map_style_user']) && !empty($options['value']['hwk_google_map_style_user']))
$atts['data-style'] = $options['value']['hwk_google_map_style_user'];
if($options['hwk_google_map_option_style_switch'] == '1' && isset($options['hwk_google_map_option_style_default']) && !empty($options['hwk_google_map_option_style_default']) && ($options['hwk_google_map_option_style_user'] != '1' || empty($options['value']['hwk_google_map_style_user'])))
$atts['data-style'] = $options['hwk_google_map_option_style_default'];
if(empty($atts))
return;
foreach($atts as $k => $v){
echo ' ' . $k . '=\'' . $v . '\'';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment