Fix theme bugs where complex JSON is echoed twice

This commit is contained in:
Skylar Ittner 2018-05-24 14:56:07 -06:00
parent 7e4783ded3
commit 9339ea12c6
5 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ include __DIR__ . "/inc/header.inc.php";
$icon = $btn['icon']; $icon = $btn['icon'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<button type="submit" class="btn btn-primary sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="submit-btn"> <button type="submit" class="btn btn-primary sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="submit-btn">
<i class="<?php echo $icon; ?>"></i> <?php echo $text; ?> <i class="<?php echo $icon; ?>"></i> <?php echo $text; ?>
</button> </button>
</form> </form>

View File

@ -12,7 +12,7 @@ include __DIR__ . "/inc/header.inc.php";
<?php <?php
$image = get_complex_component("page-image", null, ['image']); $image = get_complex_component("page-image", null, ['image']);
?> ?>
<span class="image fit sw-complex" data-json="<?php echo get_escaped_json($image); ?>" data-component="page-image"> <span class="image fit sw-complex" data-json="<?php get_escaped_json($image); ?>" data-component="page-image">
<img src="<?php get_file_url($image['image']); ?>" alt="" /> <img src="<?php get_file_url($image['image']); ?>" alt="" />
</span> </span>
<div class="sw-editable" data-component="content"> <div class="sw-editable" data-component="content">

View File

@ -22,7 +22,7 @@ include __DIR__ . "/inc/header.inc.php";
$icon = $btn['icon']; $icon = $btn['icon'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<button type="submit" class="button sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="submit-btn"> <button type="submit" class="button sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="submit-btn">
<i class="<?php echo $icon; ?>"></i> <?php echo $text; ?> <i class="<?php echo $icon; ?>"></i> <?php echo $text; ?>
</button> </button>
</li> </li>

View File

@ -39,7 +39,7 @@
$icon = $btn['icon']; $icon = $btn['icon'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<button type="submit" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="submit-btn"> <button type="submit" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="submit-btn">
<?php echo $text; ?> <?php echo $text; ?>
</button> </button>
</form> </form>

View File

@ -21,7 +21,7 @@
$link = $btn['link']; $link = $btn['link'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<a href="<?php get_url_or_slug($link); ?>" class="button big icon <?php echo $icon; ?> sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="banner-btn-1"> <a href="<?php get_url_or_slug($link); ?>" class="button big icon <?php echo $icon; ?> sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="banner-btn-1">
<?php echo $text; ?> <?php echo $text; ?>
</a> </a>
<?php } ?> <?php } ?>
@ -34,7 +34,7 @@
$link = $btn['link']; $link = $btn['link'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<a href="<?php get_url_or_slug($link); ?>" class="button alt big icon <?php echo $icon; ?> sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="banner-btn-2"> <a href="<?php get_url_or_slug($link); ?>" class="button alt big icon <?php echo $icon; ?> sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="banner-btn-2">
<?php echo $text; ?> <?php echo $text; ?>
</a> </a>
<?php } ?> <?php } ?>
@ -108,7 +108,7 @@ END;
$link = $btn['link']; $link = $btn['link'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<a href="<?php get_url_or_slug($link); ?>" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="sidebar-btn"> <a href="<?php get_url_or_slug($link); ?>" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="sidebar-btn">
<?php echo $text; ?> <?php echo $text; ?>
</a> </a>
<?php } ?> <?php } ?>
@ -132,7 +132,7 @@ END;
$link = $btn['link']; $link = $btn['link'];
$text = $btn['text']; $text = $btn['text'];
?> ?>
<a href="<?php get_url_or_slug($link); ?>" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php echo get_escaped_json($btn); ?>" data-component="two-btn"> <a href="<?php get_url_or_slug($link); ?>" class="button icon <?php echo $icon; ?> sw-complex" data-json="<?php get_escaped_json($btn); ?>" data-component="two-btn">
<?php echo $text; ?> <?php echo $text; ?>
</a> </a>
<?php } ?> <?php } ?>