Simple Map - Version 2.14.5

Version Description

Download this release

Release Info

Developer miyauchi
Plugin Icon wp plugin Simple Map
Version 2.14.5
Comparing to
See all releases

Code changes from version 2.14.3 to 2.14.5

Files changed (2) hide show
  1. readme.txt +1 -1
  2. simple-map.php +13 -9
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: miyauchi
3
  Tags: google maps, map, shortcode, address
4
  Requires at least: 3.9
5
  Tested up to: 4.6
6
- Stable tag: 2.14.3
7
 
8
  Easy way to embed google map(s).
9
 
3
  Tags: google maps, map, shortcode, address
4
  Requires at least: 3.9
5
  Tested up to: 4.6
6
+ Stable tag: 2.14.5
7
 
8
  Easy way to embed google map(s).
9
 
simple-map.php CHANGED
@@ -4,7 +4,7 @@
4
  * Author: Takayuki Miyauchi
5
  * Plugin URI: https://github.com/miya0001/simple-map
6
  * Description: Insert google map convert from address.
7
- * Version: 2.14.3
8
  * Author URI: http://wpist.me/
9
  * Text Domain: simple-map
10
  * Domain Path: /languages
@@ -83,14 +83,6 @@ class Simple_Map {
83
  $apikey = trim( $option['api_key_field'] );
84
  if ( ! isset( $apikey ) || empty( $apikey ) ) {
85
  add_action( 'admin_notices', array( $this, 'admin_notice__error' ) );
86
- } else {
87
- add_action( "wp_head", function() {
88
- $option = get_option( 'simple_map_settings' );
89
- echo sprintf(
90
- "<script>var google_map_api_key = '%s';</script>",
91
- esc_js( trim( $option['api_key_field'] ) )
92
- );
93
- } );
94
  }
95
 
96
  wp_embed_register_handler(
@@ -122,6 +114,18 @@ class Simple_Map {
122
  public function wp_head() {
123
 
124
  echo "<style>.simplemap img{max-width:none !important;padding:0 !important;margin:0 !important;}.staticmap,.staticmap img{max-width:100% !important;height:auto !important;}.simplemap .simplemap-content{display:none;}</style>\n";
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
 
127
  /**
4
  * Author: Takayuki Miyauchi
5
  * Plugin URI: https://github.com/miya0001/simple-map
6
  * Description: Insert google map convert from address.
7
+ * Version: 2.14.5
8
  * Author URI: http://wpist.me/
9
  * Text Domain: simple-map
10
  * Domain Path: /languages
83
  $apikey = trim( $option['api_key_field'] );
84
  if ( ! isset( $apikey ) || empty( $apikey ) ) {
85
  add_action( 'admin_notices', array( $this, 'admin_notice__error' ) );
 
 
 
 
 
 
 
 
86
  }
87
 
88
  wp_embed_register_handler(
114
  public function wp_head() {
115
 
116
  echo "<style>.simplemap img{max-width:none !important;padding:0 !important;margin:0 !important;}.staticmap,.staticmap img{max-width:100% !important;height:auto !important;}.simplemap .simplemap-content{display:none;}</style>\n";
117
+
118
+ $option = get_option( 'simple_map_settings' );
119
+ $apikey = trim( $option['api_key_field'] );
120
+ if ( isset( $apikey ) && empty( $apikey ) ) {
121
+ add_action( "wp_head", function() {
122
+ $option = get_option( 'simple_map_settings' );
123
+ echo sprintf(
124
+ "<script>var google_map_api_key = '%s';</script>",
125
+ esc_js( trim( $option['api_key_field'] ) )
126
+ );
127
+ } );
128
+ }
129
  }
130
 
131
  /**