Plugin Directory

Changeset 1389108


Ignore:
Timestamp:
04/07/2016 08:48:08 AM (10 years ago)
Author:
ank91
Message:

trunk 1.7.6

Location:
ank-google-map/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ank-google-map/trunk/ank-google-map.php

    r1367321 r1389108  
    44Plugin URI: https://github.com/ank91/ank-google-map
    55Description: Simple, light weight, and non-bloated WordPress Google Map Plugin. Written in pure javascript, no jQuery at all, responsive, configurable, no ads and 100% Free of cost.
    6 Version: 1.7.5
     6Version: 1.7.6
    77Author: Ankur Kumar
    88Author URI: http://ank91.github.io/
     
    1515if (!defined('ABSPATH')) die;
    1616
    17 define('AGM_PLUGIN_VERSION', '1.7.5');
     17define('AGM_PLUGIN_VERSION', '1.7.6');
    1818define('AGM_BASE_FILE', __FILE__);
    1919
  • ank-google-map/trunk/inc/class-admin.php

    r1367321 r1389108  
    255255        $is_min = (WP_DEBUG == 1) ? '' : '.min';
    256256        wp_enqueue_style('agm-admin-css', plugins_url('css/option-page' . $is_min . '.css', AGM_BASE_FILE), array(), AGM_PLUGIN_VERSION, 'all');
    257         wp_enqueue_script('agm-google-map', 'https://maps.googleapis.com/maps/api/js?v=3.22&libraries=places', array(), null, true);
     257        wp_enqueue_script('agm-google-map', 'https://maps.googleapis.com/maps/api/js?v=3.24&libraries=places', array(), null, true);
    258258        wp_enqueue_script('agm-admin-js', plugins_url("/js/option-page" . $is_min . ".js", AGM_BASE_FILE), array('jquery'), AGM_PLUGIN_VERSION, true);
    259259        //wp inbuilt hack to print js options object just before this script
  • ank-google-map/trunk/inc/class-frontend.php

    r1367321 r1389108  
    5656            'info_window' => array(
    5757                'enabled' => absint($options['info_on']),
    58                 'text' => wp_slash($options['info_text']),
     58                'text' => wp_unslash($options['info_text']),
    5959                'state' => absint($options['info_state']),
    6060            ),
     
    9191        echo '<div id="agm_map_canvas" style="margin: 0 auto;width:' . esc_attr($options["div_width"]) . $w_unit . ';height:' . esc_attr($options["div_height"]) . 'px;' . $b_color . '"></div>';
    9292
     93
     94        //Decide language code
     95        $lang_code = (esc_attr($options['map_lang_code']) === '') ? '' : '&language=' . esc_attr($options['map_lang_code']);
     96        //Decide API key
     97        $api_key = $this->getAPIKey() ? '&key=' . $this->getAPIKey() : '';
    9398        // Enqueue google map api
    94         $lang_code = (esc_attr($options['map_lang_code']) === '') ? '' : '&language=' . esc_attr($options['map_lang_code']);
    95         wp_enqueue_script('agm-google-map-api', "https://maps.googleapis.com/maps/api/js?v=3.22" . $lang_code, array(), null, true);
     99        wp_enqueue_script('agm-google-map-api', "https://maps.googleapis.com/maps/api/js?v=3.24" . $lang_code . $api_key, array(), null, true);
    96100
    97101        // Enqueue frontend js file
     
    132136    }
    133137
     138    /**
     139     * Check if user has defined the constant or not and return the constant value
     140     * @return bool|string
     141     */
     142    private function getAPIKey()
     143    {
     144        if (defined('AGM_API_KEY')) {
     145            return trim(AGM_API_KEY);
     146        }
     147        return false;
     148    }
     149
    134150
    135151}
  • ank-google-map/trunk/readme.txt

    r1367321 r1389108  
    33Requires at least: 3.8.0
    44Tested up to: 4.4.2
    5 Stable tag: 1.7.5
     5Stable tag: 1.7.6
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    130130* This plugin has a problem/bug. (Report it now).
    131131
     132= How do i insert the API key ? =
     133* Obtain a browser key , see steps [here](https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key)
     134* Add this line of code to your `functions.php`
     135
     136`
     137define('AGM_API_KEY', 'PASTE_YOUR_API_KEY_HERE');
     138`
    132139
    133140= Future Plans ? =
     
    147154
    148155== Changelog ==
     156
     157= 1.7.6 =
     158* Allow developers to add API key to google map (see FAQ)
     159* Bump Google Map API version to 3.24
     160* Fixed a bug in InfoWindow text
    149161
    150162= 1.7.4 =
Note: See TracChangeset for help on using the changeset viewer.