-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.php
80 lines (67 loc) · 2.57 KB
/
plugin.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* Plugin Name: ConvertKit for Caldera Forms
* Plugin URI: https://calderawp.com
* Description: ConvertKit integration for Caldera Forms
* Version: 1.0.5
* Author: Josh Pollock for CalderaWP LLC
* Author URI: https://CalderaWP.com
* License: GPLv2+
* Text Domain: cf-convertkit
* Domain Path: /languages
*/
/**
* Copyright (c) 2016 Josh Pollock for CalderaWP LLC (email : [email protected]) for CalderaWP LLC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
* your discretion, any later version, as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Define constants
*/
define( 'CF_CONVERTKIT_VER', '1.0.5' );
define( 'CF_CONVERTKIT_URL', plugin_dir_url( __FILE__ ) );
define( 'CF_CONVERTKIT_PATH', dirname( __FILE__ ) . '/' );
define( 'CF_CONVERTKIT_CORE', dirname( __FILE__ ) );
/**
* Default initialization for the plugin:
* - Registers the default textdomain.
*/
function cf_convertkit_init_text_domain() {
load_plugin_textdomain( 'cf-convertkit', FALSE, CF_CONVERTKIT_PATH . 'languages' );
}
/**
* Include Files
*/
// load dependencies
include_once CF_CONVERTKIT_PATH . 'vendor/autoload.php';
// pull in the functions file
include CF_CONVERTKIT_PATH . 'includes/functions.php';
/**
* Hooks
*/
//register text domain
add_action( 'init', 'cf_convertkit_init_text_domain' );
// add filter to register addon with Caldera Forms
add_filter('caldera_forms_get_form_processors', 'cf_convertkit_load');
// filter to initialize the license system
add_action( 'admin_init', 'cf_convertkit_init_license' );
//add our example form
//add_filter( 'caldera_forms_get_form_templates', 'cf_braintree_example_form' );
//load the add-on
add_action( 'caldera_forms_pre_load_processors', 'cf_convertkit_load' );
//add the sequences/forms refresh button to those inputs
add_action( 'caldera_forms_processor_ui_input_html', 'cf_convert_kit_add_refresh_button', 10, 3 );
//Get the dropdown options for sequences/forms via the AJAX
add_action( 'wp_ajax_cf_convertkit_dropdown_options', 'cf_convertkit_dropdown_options' );