forked from tlovett1/custom-contact-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-contact-forms.php
88 lines (77 loc) · 2.81 KB
/
custom-contact-forms.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
85
86
87
88
<?php
/**
* Plugin Name: Custom Contact Forms
* Plugin URI: http://www.taylorlovett.com
* Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
* Author: Taylor Lovett
* Version: 7.8.5
* Text Domain: custom-contact-forms
* Domain Path: /languages
* Author URI: http://www.taylorlovett.com
*/
/**
* Include plugin reqs
*/
define( 'CCF_VERSION', '7.8.5' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-form-cpt.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-submission-cpt.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-form-mail.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-field-cpt.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-choice-cpt.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-form-manager.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-field-renderer.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-form-renderer.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-form-handler.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-upgrader.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-widget.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-export.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-ads.php' );
require_once( dirname( __FILE__ ) . '/classes/class-ccf-settings.php' );
CCF_Custom_Contact_Forms::factory();
CCF_Constants::factory();
CCF_Form_CPT::factory();
CCF_Submission_CPT::factory();
CCF_Field_CPT::factory();
CCF_Choice_CPT::factory();
CCF_Form_Manager::factory();
CCF_Form_Renderer::factory();
CCF_Field_Renderer::factory();
CCF_Form_Handler::factory();
CCF_Upgrader::factory();
CCF_Export::factory();
CCF_Ads::factory();
CCF_Settings::factory();
/**
* Setup the widget
*
* @since 6.4
*/
function ccf_register_widget() {
register_widget( 'CCF_Widget' );
}
add_action( 'widgets_init', 'ccf_register_widget' );
/**
* Flush the rewrites at the end of init after the plugin is been activated.
*
* @since 6.0
*/
function ccf_flush_rewrites() {
update_option( 'ccf_flush_rewrites', true );
}
/**
* Upgrade CCF DB information
*
* @since 7.1
*/
function ccf_upgrade() {
$version = get_option( 'ccf_db_version' );
if ( empty( $version ) || version_compare( $version, '7.1', '<' ) ) {
// Upgrade to 7.1
CCF_Upgrader::factory()->notifications_upgrade_71();
}
update_option( 'ccf_db_version', '7.1' );
}
register_activation_hook( __FILE__, 'ccf_flush_rewrites' );
register_activation_hook( __FILE__, 'ccf_upgrade' );