Skip to content

Commit 87825cd

Browse files
committed
Merge branch 'develop' into loading-order
# Conflicts: # functions.php
2 parents ce9693d + fa24278 commit 87825cd

4 files changed

Lines changed: 9 additions & 17 deletions

File tree

dt-core/global-functions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ function render_field_for_display( $field_key, $fields, $post, $show_extra_contr
642642
}
643643

644644
if ( $is_legacy ) {
645+
$is_empty_post = count( array_keys( $post ) ) <= 1; // if this is a new post, it only has a post_type key
645646
?>
646647
<div class="section-subheader">
647648
<?php dt_render_field_icon( $fields[$field_key] );
@@ -692,7 +693,7 @@ class="add-link__option"
692693
</div>
693694

694695
<?php endif; ?>
695-
<?php if ( ( $field_type === 'location' || 'location_meta' === $field_type ) && DT_Mapbox_API::get_key() && ! empty( $post ) ) : ?>
696+
<?php if ( ( $field_type === 'location' || 'location_meta' === $field_type ) && DT_Mapbox_API::get_key() && !$is_empty_post ) : ?>
696697
<button data-list-class="<?php echo esc_html( $field_key ) ?>" class="add-button" id="new-mapbox-search" type="button" <?php echo esc_html( $disabled ); ?>>
697698
<img src="<?php echo esc_html( get_template_directory_uri() . '/dt-assets/images/small-add.svg' ) ?>"/>
698699
</button>
@@ -787,7 +788,7 @@ class="text-input" value="<?php echo esc_html( $post[$field_key] ?? '' ) ?>" <?p
787788
</div>
788789
</div>
789790
<?php elseif ( $field_type === 'location_meta' ) : ?>
790-
<?php if ( DT_Mapbox_API::get_key() && empty( $post ) ) : // test if Mapbox key is present ?>
791+
<?php if ( DT_Mapbox_API::get_key() && $is_empty_post ) : // test if Mapbox key is present ?>
791792
<div id="mapbox-autocomplete" class="mapbox-autocomplete input-group" data-autosubmit="false">
792793
<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 ); ?>/>
793794
<div class="input-group-button">

dt-core/utilities/dt-components.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,13 @@ public static function shared_attributes( $field_key, $fields, $post, $params =
6767
return $shared_attributes;
6868
}
6969

70-
public static function render_icon_slot( $field ) {
71-
if ( isset( $field['font-icon'] ) && !empty( $field['font-icon'] ) ): ?>
72-
<span slot="icon-start">
73-
<i class="dt-icon <?php echo esc_html( $field['font-icon'] ) ?>"></i>
74-
</span>
75-
<?php endif;
76-
}
77-
7870
public static function render_communication_channel( $field_key, $fields, $post, $params = [] ) {
7971
$shared_attributes = self::shared_attributes( $field_key, $fields, $post, $params );
8072
?>
8173
<dt-multi-text <?php echo wp_kses_post( $shared_attributes ) ?>
82-
value="<?php echo esc_attr( isset( $post[$field_key] ) ? json_encode( $post[$field_key] ) : '' ) ?>"
83-
<?php self::render_icon_slot( $fields[$field_key] ) ?>
84-
></dt-multi-text>
74+
value="<?php echo esc_attr( isset( $post[$field_key] ) ? json_encode( $post[$field_key] ) : '' ) ?>">
75+
<?php dt_render_icon_slot( $fields[$field_key] ) ?>
76+
</dt-multi-text>
8577
<?php
8678
}
8779

@@ -160,9 +152,8 @@ public static function render_location_meta( $field_key, $fields, $post, $params
160152
$shared_attributes = self::shared_attributes( $field_key, $fields, $post, $params );
161153
?>
162154
<dt-location <?php echo wp_kses_post( $shared_attributes ) ?>
163-
value="<?php echo esc_html( $post[$field_key] ?? '' ) ?>"
155+
value="<?php echo esc_html( $post[$field_key] ?? '' ) ?>">
164156
<?php dt_render_icon_slot( $fields[$field_key] ) ?>
165-
>
166157
</dt-location>
167158
<?php
168159
}

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct() {
103103
* Prepare variables
104104
*/
105105
$this->token = 'disciple_tools';
106-
$this->version = '1.70.0';
106+
$this->version = '1.70.1';
107107
// $this->migration_number = 38; // moved to Disciple_Tools_Migration_Engine::$migration_number
108108

109109
$this->theme_url = get_template_directory_uri() . '/';

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Theme Name: Disciple Tools
33
Theme URI: https://github.com/DiscipleTools/disciple-tools-theme
44
Description: Disciple.Tools is a coalition management system for disciple making movements.
55
Author URI: https://github.com/DiscipleTools
6-
Version: 1.70.0
6+
Version: 1.70.1
77
Requires at least: 4.7.0
88
License: GPL-2.0 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

0 commit comments

Comments
 (0)