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 3.9 3.9-beta 3.9.1 3.9.2 3.9.3 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1-beta 4.1.1 4.1.2 4.2 4.2-beta 4.2.1 4.2.2 4.3 4.3.1 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6 4.6.1 4.7 4.8 4.8.1 4.9 4.9.1 4.9.2 5.0 5.0.1
contact-form-7 / settings.php
contact-form-7 Last commit date
admin 9 years ago images 10 years ago includes 9 years ago languages 9 years ago modules 9 years ago license.txt 10 years ago readme.txt 9 years ago settings.php 10 years ago uninstall.php 14 years ago wp-contact-form-7.php 9 years ago
settings.php
144 lines
1 <?php
2
3 require_once WPCF7_PLUGIN_DIR . '/includes/functions.php';
4 require_once WPCF7_PLUGIN_DIR . '/includes/l10n.php';
5 require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
6 require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
7 require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
8 require_once WPCF7_PLUGIN_DIR . '/includes/capabilities.php';
9 require_once WPCF7_PLUGIN_DIR . '/includes/contact-form-template.php';
10 require_once WPCF7_PLUGIN_DIR . '/includes/contact-form.php';
11 require_once WPCF7_PLUGIN_DIR . '/includes/mail.php';
12 require_once WPCF7_PLUGIN_DIR . '/includes/submission.php';
13 require_once WPCF7_PLUGIN_DIR . '/includes/upgrade.php';
14 require_once WPCF7_PLUGIN_DIR . '/includes/integration.php';
15 require_once WPCF7_PLUGIN_DIR . '/includes/config-validator.php';
16
17 if ( is_admin() ) {
18 require_once WPCF7_PLUGIN_DIR . '/admin/admin.php';
19 } else {
20 require_once WPCF7_PLUGIN_DIR . '/includes/controller.php';
21 }
22
23 class WPCF7 {
24
25 public static function load_modules() {
26 self::load_module( 'acceptance' );
27 self::load_module( 'akismet' );
28 self::load_module( 'checkbox' );
29 self::load_module( 'count' );
30 self::load_module( 'date' );
31 self::load_module( 'file' );
32 self::load_module( 'flamingo' );
33 self::load_module( 'listo' );
34 self::load_module( 'number' );
35 self::load_module( 'quiz' );
36 self::load_module( 'really-simple-captcha' );
37 self::load_module( 'recaptcha' );
38 self::load_module( 'response' );
39 self::load_module( 'select' );
40 self::load_module( 'submit' );
41 self::load_module( 'text' );
42 self::load_module( 'textarea' );
43 }
44
45 protected static function load_module( $mod ) {
46 $dir = WPCF7_PLUGIN_MODULES_DIR;
47
48 if ( empty( $dir ) || ! is_dir( $dir ) ) {
49 return false;
50 }
51
52 $file = path_join( $dir, $mod . '.php' );
53
54 if ( file_exists( $file ) ) {
55 include_once $file;
56 }
57 }
58
59 public static function get_option( $name, $default = false ) {
60 $option = get_option( 'wpcf7' );
61
62 if ( false === $option ) {
63 return $default;
64 }
65
66 if ( isset( $option[$name] ) ) {
67 return $option[$name];
68 } else {
69 return $default;
70 }
71 }
72
73 public static function update_option( $name, $value ) {
74 $option = get_option( 'wpcf7' );
75 $option = ( false === $option ) ? array() : (array) $option;
76 $option = array_merge( $option, array( $name => $value ) );
77 update_option( 'wpcf7', $option );
78 }
79 }
80
81 add_action( 'plugins_loaded', 'wpcf7' );
82
83 function wpcf7() {
84 wpcf7_load_textdomain();
85 WPCF7::load_modules();
86
87 /* Shortcodes */
88 add_shortcode( 'contact-form-7', 'wpcf7_contact_form_tag_func' );
89 add_shortcode( 'contact-form', 'wpcf7_contact_form_tag_func' );
90 }
91
92 add_action( 'init', 'wpcf7_init' );
93
94 function wpcf7_init() {
95 wpcf7_get_request_uri();
96 wpcf7_register_post_types();
97
98 do_action( 'wpcf7_init' );
99 }
100
101 add_action( 'admin_init', 'wpcf7_upgrade' );
102
103 function wpcf7_upgrade() {
104 $old_ver = WPCF7::get_option( 'version', '0' );
105 $new_ver = WPCF7_VERSION;
106
107 if ( $old_ver == $new_ver ) {
108 return;
109 }
110
111 do_action( 'wpcf7_upgrade', $new_ver, $old_ver );
112
113 WPCF7::update_option( 'version', $new_ver );
114 }
115
116 /* Install and default settings */
117
118 add_action( 'activate_' . WPCF7_PLUGIN_BASENAME, 'wpcf7_install' );
119
120 function wpcf7_install() {
121 if ( $opt = get_option( 'wpcf7' ) ) {
122 return;
123 }
124
125 wpcf7_load_textdomain();
126 wpcf7_register_post_types();
127 wpcf7_upgrade();
128
129 if ( get_posts( array( 'post_type' => 'wpcf7_contact_form' ) ) ) {
130 return;
131 }
132
133 $contact_form = WPCF7_ContactForm::get_template( array(
134 'title' => sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ) ) );
135
136 $contact_form->save();
137
138 WPCF7::update_option( 'bulk_validate', array(
139 'timestamp' => current_time( 'timestamp' ),
140 'version' => WPCF7_VERSION,
141 'count_valid' => 1,
142 'count_invalid' => 0 ) );
143 }
144