forked from kennym/cf7-to-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-form-7-api.php
84 lines (73 loc) · 2.36 KB
/
contact-form-7-api.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
81
82
83
84
<?php
/**
* Contact form 7 API
*
*
* @link
* @since 1.0.0
* @package qs_cf7_api
*
* @wordpress-plugin
* Plugin Name: Contact form 7 to api + Basic auth
* Plugin URI: https://github.com/kennym/cf7-to-api
* Description: Connect contact forms 7 to remote API using GET or POST.
* Version: 1.4.11
* Author: Kenny Meyer
* Author URI: https://www.kennymeyer.net
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: qs-cf7-api
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'QS_CF7_API_PLUGIN_PATH' , plugin_dir_path( __FILE__ ) );
define( 'QS_CF7_API_INCLUDES_PATH' , plugin_dir_path( __FILE__ ). 'includes/' );
define( 'QS_CF7_API_TEMPLATE_PATH' , get_template_directory() );
define( 'QS_CF7_API_ADMIN_JS_URL' , plugin_dir_url( __FILE__ ). 'assets/js/' );
define( 'QS_CF7_API_ADMIN_CSS_URL' , plugin_dir_url( __FILE__ ). 'assets/css/' );
define( 'QS_CF7_API_FRONTEND_JS_URL' , plugin_dir_url( __FILE__ ). 'assets/js/' );
define( 'QS_CF7_API_FRONTEND_CSS_URL' , plugin_dir_url( __FILE__ ). 'assets/css/' );
define( 'QS_CF7_API_IMAGES_URL' , plugin_dir_url( __FILE__ ). 'assets/css/' );
add_action( 'plugins_loaded', 'qs_cf7_textdomain' );
/**
* Load plugin textdomain.
*
* @since 1.0.0
*/
function qs_cf7_textdomain() {
load_plugin_textdomain( 'qs-cf7-api', false, basename( dirname( __FILE__ ) ) . '/languages' );
}
/**
* The core plugin class
*/
require_once QS_CF7_API_INCLUDES_PATH . 'class.cf7-api.php';
/**
* Activation and deactivation hooks
*
*/
register_activation_hook( __FILE__ , 'cf7_api_activation_handler' );
register_deactivation_hook( __FILE__ , 'cf7_api_deactivation_handler' );
function cf7_api_activation_handler(){
do_action( 'cf7_api_activated' );
}
function cf7_api_deactivation_handler(){
do_action( 'cf7_api_deactivated' );
}
/**
* Begins execution of the plugin.
*
* Init the plugin process
*
* @since 1.0.0
*/
function qs_init_cf7_api() {
global $qs_cf7_api;
$qs_cf7_api = new QS_CF7_atp_integration();
$qs_cf7_api->version = '1.1.1';
$qs_cf7_api->plugin_basename = plugin_basename( __FILE__ );
$qs_cf7_api->init();
}
qs_init_cf7_api();