Plugin Directory

Changeset 2048846


Ignore:
Timestamp:
03/12/2019 08:34:32 AM (7 years ago)
Author:
DevFabio
Message:

fix minor bug

Location:
autocompletamento-indirizzo-contact-form-7/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • autocompletamento-indirizzo-contact-form-7/trunk/autocompletamento-indirizzo-contact-form-7.php

    r2048106 r2048846  
    55 */
    66/*
    7 Plugin Name: Autocompletamento indirizzo contact form 7
     7Plugin Name: Autocompletamento indirizzo Contact Form 7
    88Plugin URI: http://wordpress.org/plugins/autocompletamento-indirizzo-contact-form-7/
    99Description: Aiuta i tuoi utenti con l'autocompilazione dei campi di Indirizzo (partenza, destinazione) e calcola la distanza con il servizio Google Place. CF7
    1010Author: DevFabio
    11 Version: 0.1.2
     11Version: 0.1.3
    1212Author URI: http://inventyourtrade.it
    1313*/
    1414
    15 /* Below we are making sure the script is only loaded on the page designated in the Google Places API settings page (i.e. Contact, Home, etc.). */
    16 
    17 /*  Once you have your key enter it in the Google Places API Key field on the Google Places API settings page. */
    18 wp_enqueue_script( 'autocompletament_script', plugin_dir_url(__FILE__). 'js/script-mappa.js', array(), 'null', true );
     15function autocompletament_load_primo(){
     16    wp_enqueue_script( 'autocompletament_script', plugin_dir_url(__FILE__). 'js/script-mappa.js', array(), 'null', true );
     17    wp_localize_script( 'autocompletament_script', 'url_sitoweb', plugin_dir_url(__FILE__).'calcola-distanza.php' );
     18    wp_enqueue_script( 'autocompletament_script' );
     19    }
     20add_action('wp_enqueue_scripts','autocompletament_load_primo');
    1921add_action( 'wp_enqueue_scripts', 'autocompletament_gpa_load_user_api' );
    20 
    21 //wp_enqueue_script( 'autocompletament_indirizzo-carica-google-map', $api_script, array(), 'null', true );
    22 
    23 wp_localize_script( 'autocompletament_script', 'url_sitoweb', plugin_dir_url(__FILE__).'calcola-distanza.php' );
    24 
    25 
    26 wp_enqueue_script( 'autocompletament_script' );
    2722/* Inizio seconda parte*/
    2823/***************
     
    4338        $securee = 'http';
    4439  }
    45   $api_script .= $securee.'://maps.googleapis.com/maps/api/js?key=' . $api_key . '&libraries=places&callback=initAutocomplete';
    46  
    47   /* Below we are making sure the script is only loaded on the page designated in the Google Places API settings page (i.e. Contact, Home, etc.). */
    48    
    49     /*  Once you have your key enter it in the Google Places API Key field on the Google Places API settings page. */
    50       wp_enqueue_script( 'gpa-google-places-api', $api_script, array(), 'null', true );
     40  $api_script = $securee.'://maps.googleapis.com/maps/api/js?key=' . $api_key . '&libraries=places&callback=initAutocomplete';
     41 
     42  wp_enqueue_script( 'gpa-google-places-api', $api_script, array(), 'null', true );
    5143   
    5244}
     
    158150{
    159151?>
    160     <input type="text" required name="orem_cf7_geo_api_key" id="api_key" value="<?php echo get_option('orem_cf7_geo_api_key')?>" />
     152    <input type="password" required name="orem_cf7_geo_api_key" id="api_key" value="<?php echo get_option('orem_cf7_geo_api_key')?>" />
    161153<?php
    162154}
     
    387379 
    388380function autocompletament_indirizzo_add_form_tag() {
    389     wpcf7_add_shortcode(array( 'partenza', 'arrivo','distanza'),  'autocompletament_indirizzo_partenza_form_tag_handler', true);
    390     wpcf7_add_form_tag( array( 'partenza', 'arrivo','distanza'), 'autocompletament_indirizzo_partenza_form_tag_handler' ); // partenza
     381    wpcf7_add_form_tag( array( 'partenza', 'arrivo','distanza'), 'autocompletament_indirizzo_partenza_form_tag_handler', true ); // partenza
    391382}
    392383function autocompletament_indirizzo_partenza_form_tag_handler( $tag ) {
  • autocompletamento-indirizzo-contact-form-7/trunk/readme.txt

    r2048106 r2048846  
    1 === Autocompletamento indirizzo contact form 7 ===
     1=== Autocompletamento indirizzo Contact Form 7 ===
    22Contributors: DevFabio
    33Tags: Cf7, Address, Google map, Distanza
     
    1717- Google Place API
    1818- Autocompilazione campi di indirizzo (partenza, destinazione)
    19 - calcolo della distanza
     19- Calcolo della distanza
Note: See TracChangeset for help on using the changeset viewer.