@@ -645,6 +645,9 @@ function render_field_for_display( $field_key, $fields, $post, $show_extra_contr
645645 case 'textarea ' :
646646 DT_Components::render_textarea ( $ field_key , $ fields , $ post , $ params );
647647 break ;
648+ case 'location_meta ' :
649+ DT_Components::render_location_meta ( $ field_key , $ fields , $ post , $ params );
650+ break ;
648651 default :
649652 $ is_legacy = true ;
650653 break ;
@@ -702,11 +705,6 @@ class="add-link__option"
702705 </div>
703706
704707 <?php endif ; ?>
705- <?php if ( ( $ field_type === 'location ' || 'location_meta ' === $ field_type ) && DT_Mapbox_API::get_key () && !$ is_empty_post ) : ?>
706- <button data-list-class="<?php echo esc_html ( $ field_key ) ?> " class="add-button" id="new-mapbox-search" type="button" <?php echo esc_html ( $ disabled ); ?> >
707- <img src="<?php echo esc_html ( get_template_directory_uri () . '/dt-assets/images/small-add.svg ' ) ?> "/>
708- </button>
709- <?php endif ?>
710708 </div>
711709 <?php
712710 // render fields
@@ -796,42 +794,6 @@ class="text-input" value="<?php echo esc_html( $post[$field_key] ?? '' ) ?>" <?p
796794 <button id="<?php echo esc_html ( $ display_field_id ); ?> -clear-button" class="button alert clear-date-button" data-inputid="<?php echo esc_html ( $ display_field_id ); ?> " title="Delete Date" type="button" <?php echo esc_html ( $ disabled ); ?> >x</button>
797795 </div>
798796 </div>
799- <?php elseif ( $ field_type === 'location_meta ' ) : ?>
800- <?php if ( DT_Mapbox_API::get_key () && $ is_empty_post ) : // test if Mapbox key is present ?>
801- <div id="mapbox-autocomplete" class="mapbox-autocomplete input-group" data-autosubmit="false">
802- <input id="mapbox-search" type="text" class="input-group-field" name="mapbox_search" placeholder="Search Location" autocomplete="off" dir="auto" <?php echo esc_html ( $ disabled ); ?> />
803- <div class="input-group-button">
804- <button id="mapbox-spinner-button" class="button hollow" style="display:none;" <?php echo esc_html ( $ disabled ); ?> ><span class="loading-spinner active"></span></button>
805- <button id="mapbox-clear-autocomplete" class="button alert input-height delete-button-style mapbox-delete-button" style="display:none;" type="button" <?php echo esc_html ( $ disabled ); ?> >×</button>
806- </div>
807- <div id="mapbox-autocomplete-list" class="mapbox-autocomplete-items"></div>
808- </div>
809- <script>
810- jQuery(document).ready(function(){
811- window.write_input_widget()
812- })
813- </script>
814- <?php elseif ( DT_Mapbox_API::get_key () ) : // test if Mapbox key is present ?>
815- <div id="mapbox-wrapper"></div>
816- <?php endif ; ?>
817- <?php elseif ( $ field_type === 'location ' ) :?>
818- <div class="dt_location_grid" data-id="<?php echo esc_html ( $ field_key ); ?> ">
819- <var id="<?php echo esc_html ( $ field_key ); ?> -result-container" class="result-container"></var>
820- <div id="<?php echo esc_html ( $ field_key ); ?> _t" name="form-<?php echo esc_html ( $ field_key ); ?> " class="scrollable-typeahead typeahead-margin-when-active">
821- <div class="typeahead__container">
822- <div class="typeahead__field">
823- <span class="typeahead__query">
824- <input class="js-typeahead-<?php echo esc_html ( $ display_field_id ); ?> input-height"
825- data-field="<?php echo esc_html ( $ field_key ); ?> "
826- data-field_type="location"
827- name="<?php echo esc_html ( $ field_key ); ?> [query]"
828- placeholder="<?php echo esc_html ( sprintf ( _x ( 'Search %s ' , "Search 'something' " , 'disciple_tools ' ), $ fields [$ field_key ]['name ' ] ) )?> "
829- autocomplete="off" <?php echo esc_html ( $ disabled ); ?> />
830- </span>
831- </div>
832- </div>
833- </div>
834- </div>
835797 <?php elseif ( $ field_type === 'user_select ' ) : ?>
836798 <div id="<?php echo esc_html ( $ field_key ); ?> " class="<?php echo esc_html ( $ display_field_id ); ?> dt_user_select">
837799 <var id="<?php echo esc_html ( $ display_field_id ); ?> -result-container" class="result-container <?php echo esc_html ( $ display_field_id ); ?> -result-container"></var>
0 commit comments