forked from CalderaWP/Caldera-Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaldera-core.php
81 lines (66 loc) · 2.69 KB
/
caldera-core.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: Caldera Forms
Plugin URI: https://calderawp.com/caldera-forms/
Description: Easy to use, grid based responsive form builder for creating simple to complex forms.
Author: David Cramer
Version: 1.3.5.3
Author URI: https://calderawp.com
Text Domain: caldera-forms
GitHub Plugin URI: https://github.com/Desertsnowman/Caldera-Forms/
GitHub Branch: current-stable
*/
//initilize plugin
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define('CFCORE_PATH', plugin_dir_path(__FILE__));
define('CFCORE_URL', plugin_dir_url(__FILE__));
define('CFCORE_VER', '1.3.5.3');
define('CFCORE_EXTEND_URL', 'https://api.calderaforms.com/1.0/');
define('CFCORE_BASENAME', plugin_basename( __FILE__ ));
/**
* Caldera Forms DB version
*
* @since 1.3.4
*
* PLEASE keep this an integer
*/
define( 'CF_DB', 3 );
// init internals of CF
include_once CFCORE_PATH . 'classes/core.php'; // neeeds the core at the very least before plugins loaded
add_action( 'init', array( 'Caldera_Forms', 'init_cf_internal' ) );
// table builder
register_activation_hook( __FILE__, array( 'Caldera_Forms', 'activate_caldera_forms' ) );
// load system
add_action( 'plugins_loaded', 'caldera_forms_load', 0 );
function caldera_forms_load(){
include_once CFCORE_PATH . 'classes/autoloader.php';
include_once CFCORE_PATH . 'classes/widget.php';
Caldera_Forms_Autoloader::add_root( 'Caldera_Forms_DB', CFCORE_PATH . 'classes/db' );
Caldera_Forms_Autoloader::add_root( 'Caldera_Forms_Processor_Interface', CFCORE_PATH . 'processors/classes/interfaces' );
Caldera_Forms_Autoloader::add_root( 'Caldera_Forms_Processor', CFCORE_PATH . 'processors/classes' );
Caldera_Forms_Autoloader::add_root( 'Caldera_Forms', CFCORE_PATH . 'classes' );
Caldera_Forms_Autoloader::register();
// includes
include_once CFCORE_PATH . 'includes/ajax.php';
include_once CFCORE_PATH . 'includes/field_processors.php';
include_once CFCORE_PATH . 'includes/custom_field_class.php';
include_once CFCORE_PATH . 'includes/filter_addon_plugins.php';
include_once CFCORE_PATH . 'includes/compat.php';
include_once CFCORE_PATH . 'processors/functions.php';
/**
* Runs after all of the includes and autoloade setup is done in Caldera Forms core
*
* @since 1.3.6
*/
do_action( 'caldera_forms_includes_complete' );
}
add_action( 'plugins_loaded', array( 'Caldera_Forms', 'get_instance' ) );
add_action( 'plugins_loaded', array( 'Caldera_Forms_Tracking', 'get_instance' ) );
// Admin & Admin Ajax stuff.
if ( is_admin() || defined( 'DOING_AJAX' ) ) {
add_action( 'plugins_loaded', array( 'Caldera_Forms_Admin', 'get_instance' ) );
add_action( 'plugins_loaded', array( 'Caldera_Forms_Support', 'get_instance' ) );
}