This file contains hidden or 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
| function new_map($el){ | |
| var $markers = $el.find('.marker'); | |
| var args = { | |
| zoom : 16, | |
| center : new google.maps.LatLng(0, 0), | |
| mapTypeId : google.maps.MapTypeId.ROADMAP | |
| }; | |
This file contains hidden or 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 get_header(); ?> | |
| <?php if(have_posts()): ?> | |
| <?php while(have_posts()): the_post(); ?> | |
| <?php if($map = get_field('google_map')){ ?> | |
| <?php $options = get_field_object('google_map'); ?> | |
| <div class="acf-map"<?php hwk_acf_map_atts($options); ?>> |
This file contains hidden or 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 | |
| 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'] . '\''; | |
| } |
This file contains hidden or 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_filter('hwk/acf/google_map/icons', 'hwk_acf_google_map_icons'); | |
| function hwk_acf_google_map_icons($icons){ | |
| $icons[] = get_template_directory_uri() . '/assets/markers/1.svg'; | |
| $icons[] = get_template_directory_uri() . '/assets/markers/2.svg'; | |
| $icons[] = get_template_directory_uri() . '/assets/markers/3.svg'; | |
| $icons[] = get_template_directory_uri() . '/assets/markers/4.svg'; | |
| $icons[] = get_template_directory_uri() . '/assets/markers/5.svg'; | |
This file contains hidden or 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
| .hwk_google_map_wrapper{ | |
| border: 1px solid #ddd; border-top:0; | |
| } | |
| .hwk_google_map_wrapper .error{ | |
| border:1px solid #bb0000 !important; | |
| } | |
| .hwk_google_map_icon li{ | |
| margin-right:5px !important; | |
| } | |
| .hwk_google_map_icon label input{ |
This file contains hidden or 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
| jQuery(document).ready(function($){ | |
| // Google Map Init | |
| acf.add_action('google_map_init', function(map, marker, $field){ | |
| google.maps.event.addListener(map, 'zoom_changed', function(e){ | |
| this.$el.closest('.acf-field-google-map').find('.hwk_google_map_zoom').val(this.getZoom()).trigger('change'); | |
| }); | |
| }); | |
| // Google Map Args |
This file contains hidden or 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/type=google_map', 'hwk_acf_google_map_render'); | |
| function hwk_acf_google_map_render($field){ | |
| echo '<div class="acf-fields -left hwk_google_map_wrapper">'; | |
| acf_render_field_wrap(array( | |
| 'key' => 'hwk_google_map_options', | |
| 'name' => 'hwk_google_map_options', |
This file contains hidden or 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', |
This file contains hidden or 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
| .column-type{ | |
| width:125px; | |
| } | |
| td.column-type a{ | |
| word-wrap: break-word; | |
| padding: 2px 5px; | |
| margin: 0 1px; | |
| border-radius:2px; | |
| background: rgba(0,0,0,.05); | |
| color:#333; |
This file contains hidden or 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('admin_menu', 'hwk_acf_taxonomy_submenu'); | |
| function hwk_acf_taxonomy_submenu(){ | |
| if(!acf_get_setting('show_admin')) | |
| return; | |
| $cap = acf_get_setting('capability'); | |
| add_submenu_page('edit.php?post_type=acf-field-group', 'Types', 'Types', $cap, 'edit-tags.php?taxonomy=acf-field-group-type'); | |
| } |