Last active
April 14, 2018 18:11
-
-
Save hawkidoki/eeb7db3cc3408c273038db74db2215f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('acf/render_field_settings/type=google_map', 'hwk_acf_google_map_settings'); | |
function hwk_acf_google_map_settings($field){ | |
acf_render_field_setting($field, array( | |
'key' => 'hwk_google_map_option_style_switch', | |
'name' => 'hwk_google_map_option_style_switch', | |
'type' => 'true_false', | |
'label' => 'Style par défaut', | |
'instructions' => 'Définir un style par défaut', | |
'value' => (isset($field['hwk_google_map_option_style_switch'])) ? $field['hwk_google_map_option_style_switch'] : '', | |
'default_value' => true, | |
'ui' => true, | |
)); | |
acf_render_field_setting($field, array( | |
'key' => 'hwk_google_map_option_style_default', | |
'name' => 'hwk_google_map_option_style_default', | |
'type' => 'textarea', | |
'label' => 'Style par défaut', | |
'instructions' => '<a href="https://snazzymaps.com/" target="_blank">Snazzy Maps</a>', | |
'value' => (isset($field['hwk_google_map_option_style_default'])) ? $field['hwk_google_map_option_style_default'] : '', | |
'new_lines' => '', | |
'conditional_logic' => array( | |
array( | |
array( | |
'field' => 'hwk_google_map_option_style_switch', | |
'operator' => '==', | |
'value' => '1', | |
), | |
), | |
), | |
)); | |
acf_render_field_setting($field, array( | |
'name' => 'hwk_google_map_option_style_user', | |
'type' => 'true_false', | |
'label' => 'Style utilisateur', | |
'instructions' => 'Laisser l\'utilisateur appliquer un style?', | |
'value' => (isset($field['hwk_google_map_option_style_user'])) ? $field['hwk_google_map_option_style_user'] : '', | |
'default_value' => true, | |
'ui' => true, | |
)); | |
acf_render_field_setting($field, array( | |
'name' => 'hwk_google_map_option_zoom', | |
'type' => 'true_false', | |
'label' => 'Niveau de Zoom', | |
'instructions' => 'Laisser l\'utilisateur choisir le zoom?', | |
'value' => (isset($field['hwk_google_map_option_zoom'])) ? $field['hwk_google_map_option_zoom'] : '', | |
'default_value' => true, | |
'ui' => true, | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment