-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgoogle-places.php
46 lines (38 loc) · 1.31 KB
/
google-places.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @link https://github.com/davebonds/
* @since 1.0.0
* @package GFormsGooglePlaces
*
* @wordpress-plugin
* Plugin Name: Gravity Forms Google Places
* Plugin URI: https://github.com/davebonds/gravity-forms-google-places
* Description: Adds a Gravity Forms field type for autocompleting addresses using the Google Places API.
* Version: 1.0.0
* Author: Dave Bonds
* Author URI: https://github.com/davebonds/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: gforms-google-places
* Domain Path: /languages
*/
define( 'GF_GOOGLE_PLACES_ADDON_VERSION', '1.0.0' );
define( 'GF_GOOGLE_PLACES_ADDON_URL', plugins_url( '/', __FILE__ ) );
add_action( 'gform_loaded', array( 'GFormsGooglePlaces', 'load' ), 5 );
/**
* Loads plugin class and registers addon with Gravity Forms.
*/
class GFormsGooglePlaces {
/**
* Loads plugin class and registers addon with Gravity Forms.
*
* @return void|null Returns early if Gravity Forms not active.
*/
public static function load() {
if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) {
return;
}
require_once __DIR__ . '/classes/gforms-google-places.php';
GFAddOn::register( 'GPlacesAddon' );
}
}