Plugin Directory

Changeset 1721356


Ignore:
Timestamp:
08/29/2017 04:11:08 PM (8 years ago)
Author:
robertreborobert
Message:

Fix console error

Location:
witty-map/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • witty-map/trunk/public/class-wittymap-public.php

    r1666057 r1721356  
    2020
    2121    public function __construct(){
    22 
    23         add_action( 'wp_enqueue_scripts', [ $this, 'enqueue' ] );
    2422        $this->shortcodes();
    2523        $this->load_supports();
     24        add_action( 'wp_enqueue_scripts', [ $this, 'enqueue' ] );
    2625        $this->gmap_api = esc_attr( get_option('googlemapapi_key') );
    2726        if( empty( $this->gmap_api ) )
     
    2928    }
    3029
    31     /**markerwithlabel.js
     30    /**
    3231     * Enqueue files
    3332     */
    3433    public function enqueue(){
    35 
    36         wp_enqueue_style(   'witty-map', WITTY_DIR_URL . '/public/css/witty-map-base.css' );
    37         wp_enqueue_script(  'googlemap-api', 'https://maps.googleapis.com/maps/api/js?key=' . $this->gmap_api, [], '', true );
    38         wp_enqueue_script(  'markerwithlabel', WITTY_DIR_URL . '/public/js/markerwithlabel.js', [], '', true );
    39         wp_enqueue_script(  'witty-map', WITTY_DIR_URL . '/public/js/googlemap.js', [], '', true );
     34        wp_register_style(  'witty-map', WITTY_DIR_URL . '/public/css/witty-map-base.css', array(), true );
     35        wp_register_script( 'googlemap-api', 'https://maps.googleapis.com/maps/api/js?key=' . $this->gmap_api, array(), true, true );
     36        wp_register_script( 'markerwithlabel', WITTY_DIR_URL . '/public/js/markerwithlabel.js', array(), true, true );
     37        wp_register_script( 'witty-map', WITTY_DIR_URL . '/public/js/googlemap.js', array(), true, true );
    4038        wp_localize_script( 'witty-map', 'wm', [
    4139            'wittyMapLocation' => get_option('wittymap_loc'),
     
    8280     */
    8381    public function witty_map_render(){
    84 
     82        wp_enqueue_style( 'witty-map' );
     83        wp_enqueue_script( 'googlemap-api' );
     84        wp_enqueue_script( 'markerwithlabel' );
     85        wp_enqueue_script( 'witty-map' );
    8586        $support = $this->support;
    8687        do_action( 'witty_map_before' );
  • witty-map/trunk/readme.txt

    r1699294 r1721356  
    55Requires at least: 4
    66Tested up to: 4.8
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4343= How to echo map in code =
    4444
    45 echo do_shortcode('[googleMap]');
     45echo do_shortcode('[witty-map]');
    4646
    4747= List of witty map action =
     
    5353
    5454== Changelog ==
     55
     56= 1.0.3 =
     57* Fix script error in console
    5558
    5659= 1.0.2 =
  • witty-map/trunk/witty-map.php

    r1699295 r1721356  
    44Plugin URI: 
    55Description: Witty Map, add google map in content                                                                   area or in template file (using shortcode). Most important you can                                                              customize its view.
    6 Version:     1.0.2
     6Version:     1.0.3
    77Author:      Robert John Concepcion
    88Author URI:  https://github.com/robert-john-concepcion
Note: See TracChangeset for help on using the changeset viewer.