forked from hassiron/gf-postcode-lookup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gf-postcode-lookup.php
52 lines (43 loc) · 1.52 KB
/
gf-postcode-lookup.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
47
48
49
50
51
52
<?php
/**
* Gravity Forms: Postcode Look-up Field
*
* This file is used by WordPress to generate the plugin information and load it
* into the CMS
*
* @since 1.0.0
* @package GF_Postcode_Lookup
*
* @wordpress-plugin
* Plugin Name: Gravity Forms: Postcode Look-up Field
* Plugin URI: https://www.github.com/vyygir/gf-postcode-lookup
* Description: A field for Gravity Forms that allows postcode look-up implementations using the getaddress.io API
* Version: 1.0.1
* Author: Vyygir
* Author URI: https://vyygir.me
* Text Domain: gf-postcode-lookup
*/
if (!defined('WPINC')) {
exit;
}
require_once 'vendor/autoload.php';
define('GF_POSTCODE_LOOKUP_VERSION', '1.0.0');
define('GF_POSTCODE_LOOKUP_PATH', plugin_dir_path(__FILE__));
define('GF_POSTCODE_LOOKUP_URL', plugin_dir_url(__FILE__));
define('GF_POSTCODE_LOOKUP_DOMAIN', 'gf-postcode-lookup');
// initialise the customised updater
require_once GF_POSTCODE_LOOKUP_PATH . 'includes/class-updater.php';
if (is_admin()) {
new Postcode_Lookup_Updater(__FILE__, 'vyygir', 'gf-postcode-lookup');
}
// create the GF add-on
add_action('gform_loaded', function() {
if (method_exists('GFForms', 'include_addon_framework')) {
global $gfPostcodeLookupAddon;
GFForms::include_addon_framework();
require_once GF_POSTCODE_LOOKUP_PATH . 'includes/class-gf-postcode-lookup.php';
require_once GF_POSTCODE_LOOKUP_PATH . 'includes/class-postcode-lookup.php';
Postcode_Lookup::listen();
GFAddOn::register('GFPostcodeLookup');
}
}, 5);