Skip to content

Commit

Permalink
fix: make json decode properly on loading
Browse files Browse the repository at this point in the history
  • Loading branch information
rozklad committed May 10, 2021
1 parent a69fefb commit be0c2f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acf-mapmore.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Advanced Custom Fields: MapMore
Plugin URI: https://bitterend.io
Description: Map complex field for Advanced Custom Fields
Version: 1.0.1
Version: 1.1.0
Author: bitterend
Author URI: https://bitterend.io
License: GPLv2 or later
Expand Down
2 changes: 1 addition & 1 deletion assets/js/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
// Avoid MapMore.prototype conflicts
$.extend( MapMore.prototype, {
init: function() {

this.map = this.settings.map;
this.mapDiv = this.map.getDiv();
this.locations = this.settings.locations;
Expand Down
2 changes: 1 addition & 1 deletion fields/acf-mapmore-v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function render_field( $field ) {

<?php if ( json_last_error() === JSON_ERROR_NONE ) : ?>

locations<?= $map_id_js ?> = JSON.parse(<?= json_encode( $field['value'] ) ?>);
locations<?= $map_id_js ?> = JSON.parse(JSON.parse(<?= json_encode( $field['value'] ) ?>));

<?php endif; ?>

Expand Down

0 comments on commit be0c2f8

Please sign in to comment.