Version Description
- Fixed: Error with 1.3.1 Lite release
Download this release
Release Info
Developer | jaredatch |
Plugin | Contact Form by WPForms – Drag & Drop Form Builder for WordPress |
Version | 1.3.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.1.1
- readme.txt +3 -0
- wpforms.php +297 -426
readme.txt
CHANGED
@@ -163,6 +163,9 @@ Syed Balkhi
|
|
163 |
|
164 |
== Changelog ==
|
165 |
|
|
|
|
|
|
|
166 |
= 1.3.1 =
|
167 |
- Added: Smart Tags for author ID, email, and name
|
168 |
- Added: Carbon Copy (CC) support for form notifications; enable in WPForms Settings
|
163 |
|
164 |
== Changelog ==
|
165 |
|
166 |
+
= 1.3.1.1 =
|
167 |
+
- Fixed: Error with 1.3.1 Lite release
|
168 |
+
|
169 |
= 1.3.1 =
|
170 |
- Added: Smart Tags for author ID, email, and name
|
171 |
- Added: Carbon Copy (CC) support for form notifications; enable in WPForms Settings
|
wpforms.php
CHANGED
@@ -1,426 +1,297 @@
|
|
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 |
-
*
|
89 |
-
*
|
90 |
-
*
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
*
|
96 |
-
*
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
*
|
114 |
-
*
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
=
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
*
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
*
|
282 |
-
|
283 |
-
|
284 |
-
*
|
285 |
-
|
286 |
-
=
|
287 |
-
*
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
= 1.1.7.1 =
|
299 |
-
* Changed: Removed "New" field name prefix
|
300 |
-
|
301 |
-
= 1.1.7 =
|
302 |
-
* Added: Smart Tag for Dropdown/Multiple choice raw values, allowing for conditional email addres notifications (https://wpforms.com/docs/how-to-create-conditional-form-notifications-in-wpforms)
|
303 |
-
* Added: Three column CSS field classes (https://wpforms.com/docs/how-to-create-multi-column-form-layouts-in-wpforms/)
|
304 |
-
* Changed: Checkbox/Multiple Choice fields allow certain HTML to display in choice labels
|
305 |
-
|
306 |
-
= 1.1.6.1 =
|
307 |
-
* Added: Support for WordPress Zero Spam plugin (https://wordpress.org/plugins/zero-spam/)
|
308 |
-
* Fixed: Issue when stacking fields with 2 column classes
|
309 |
-
|
310 |
-
= 1.1.5.3 =
|
311 |
-
* Changed: Email Header Image setting description to include recommended sizing
|
312 |
-
|
313 |
-
= 1.1.5.2 =
|
314 |
-
* Fixed: reCAPTCHA cutting off with full form theme
|
315 |
-
|
316 |
-
= 1.1.5.1 =
|
317 |
-
* Fixed: Debug output from wpforms.js
|
318 |
-
|
319 |
-
= 1.1.5 =
|
320 |
-
* Changed: HTML Email template footer text appearance
|
321 |
-
|
322 |
-
= 1.1.4.2 =
|
323 |
-
* Fixed: HTML emails not displaying correctly in Thunderbird
|
324 |
-
|
325 |
-
= 1.1.4.1 =
|
326 |
-
* Fixed: Form builder textareas not displaying full width
|
327 |
-
|
328 |
-
= 1.1.4 =
|
329 |
-
* Added: Form general setting for "Submit Button CSS Class"
|
330 |
-
* Added: Duplicate forms from the Forms Overview page (All Forms)
|
331 |
-
* Changed: Adjusted field display inside the Form Builder to better resemble full theme
|
332 |
-
* Fixed: Don't allow inserting shortcode via modal if there are no forms
|
333 |
-
* Fixed: Error when deleting a form
|
334 |
-
|
335 |
-
= 1.1.3.2 =
|
336 |
-
* Added: Suggestion form template
|
337 |
-
|
338 |
-
= 1.1.3.1 =
|
339 |
-
* Fixed: Form base theme CSS compatibility issue with Firefox
|
340 |
-
|
341 |
-
= 1.1.3 =
|
342 |
-
* Added: New class that handles sending/processing emails
|
343 |
-
* Added: Form notification setting for "From Address", defaults to site administrator's email address
|
344 |
-
* Added: HTML email template for sleek emails (enabled by default, see more below)
|
345 |
-
* Added: General setting to configure email notification format
|
346 |
-
* Added: General setting to optionally configure email notification header image
|
347 |
-
* Changed: Default email notification format is now HTML, can go back to plain text format via option on WPForms > Settings page
|
348 |
-
* Changed: Empty fields are no longer included in email notifications
|
349 |
-
* Fixed: Issue with Checkbox field when empty
|
350 |
-
|
351 |
-
= 1.1.2 =
|
352 |
-
* Added: Form option to scroll page to form after submit, defaults on for new forms
|
353 |
-
* Changed: Revamped "Full" form theme to be more consistent across different themes, browsers, and devices
|
354 |
-
* Changed: Full theme and bare theme separated
|
355 |
-
|
356 |
-
= 1.1.1.1 =
|
357 |
-
* Changed: Upgrade information
|
358 |
-
|
359 |
-
= 1.1.1 =
|
360 |
-
* Fixed: Settings page typo
|
361 |
-
|
362 |
-
= 1.1 =
|
363 |
-
* Changed: CSS updates to improve compatibility
|
364 |
-
* Fixed: PHP notices when saving plugin Settings
|
365 |
-
|
366 |
-
= 1.0.9 =
|
367 |
-
* Changed: Email field required by default
|
368 |
-
|
369 |
-
= 1.0.8 =
|
370 |
-
* Fixed: Name field setting always showing Required
|
371 |
-
* Fixed: Debug function incorrectly requiring WP_DEBUG
|
372 |
-
|
373 |
-
= 1.0.7 =
|
374 |
-
* Changed: CSS tweaks
|
375 |
-
* Fixed: Filter (wpforms_manage_cap) incorrectly named in some instances
|
376 |
-
|
377 |
-
= 1.0.6 =
|
378 |
-
* Added: Embed button inside the Form Builder
|
379 |
-
* Added: Basic two column CSS class support
|
380 |
-
* Added: French translation
|
381 |
-
* Changed: Form names are no longer required, if no form name is provided the template name is used
|
382 |
-
* Changed: Inputmask script, for better broad device support
|
383 |
-
* Changed: Field specific assets are now conditionally loaded
|
384 |
-
* Changed: CSS tweaks for form display
|
385 |
-
* Fixed: Issue with Date/Time field
|
386 |
-
* Fixed: Issue Address field preventing Country select from hiding in some configurations
|
387 |
-
* Fixed: Localization string errors
|
388 |
-
|
389 |
-
= 1.0.5 =
|
390 |
-
* Changed: Checkboxes/Dropdown/Multiple Choice fields always show choice label value in e-mail notifications
|
391 |
-
* Fixed: PHP notices inside the Form Builder
|
392 |
-
* Fixed: Typo inside Form Builder tooltip
|
393 |
-
|
394 |
-
= 1.0.4.2 =
|
395 |
-
* Changed: Removed files not needed for WordPress.org release [Lite]
|
396 |
-
|
397 |
-
= 1.0.4.1 =
|
398 |
-
* Added: Check for TinyMCE in the builder before triggering TinyMCE save
|
399 |
-
* Fixed: Sub labels showing when configured to hide
|
400 |
-
* Fixed: Forms pagination number screen setting not saving
|
401 |
-
* Fixed: Email notification setting always displaying "On"
|
402 |
-
|
403 |
-
= 1.0.4 =
|
404 |
-
* Changed: Improved marketing provider conditional logic
|
405 |
-
* Changed: Addons page [Lite]
|
406 |
-
* Fixed: Variable assignment in the builder
|
407 |
-
|
408 |
-
= 1.0.3 =
|
409 |
-
* Added: Basic TinyMCE editor for form confirmation messages
|
410 |
-
* Changed: Removed form ID from form overview table, ID still visible in shortcode column
|
411 |
-
* Fixed: Checkbox/radio form elements alignment
|
412 |
-
* Fixed: Quotation slashes in email notification text
|
413 |
-
* Fixed: SSL verification preventing proper API calls on some servers
|
414 |
-
|
415 |
-
= 1.0.2 =
|
416 |
-
* Added: Widget to display form
|
417 |
-
* Added: Function to display form, `wpforms_display( $form_id )`
|
418 |
-
* Changed: Default notification settings for Contact form template
|
419 |
-
* Changed: Success message styling for full form theme
|
420 |
-
|
421 |
-
= 1.0.1 =
|
422 |
-
* Added: "From Name" and "Reply To" Setting>Notification fields
|
423 |
-
* Added: Smart Tags feature to all Setting>Notification fields
|
424 |
-
|
425 |
-
= 1.0.0 =
|
426 |
-
* Initial release.
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: WPForms
|
4 |
+
* Plugin URI: https://wpforms.com
|
5 |
+
* Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
|
6 |
+
* Author: WPForms
|
7 |
+
* Author URI: https://wpforms.com
|
8 |
+
* Version: 1.3.1.1
|
9 |
+
* Text Domain: wpforms
|
10 |
+
* Domain Path: languages
|
11 |
+
*
|
12 |
+
* WPForms is free software: you can redistribute it and/or modify
|
13 |
+
* it under the terms of the GNU General Public License as published by
|
14 |
+
* the Free Software Foundation, either version 2 of the License, or
|
15 |
+
* any later version.
|
16 |
+
*
|
17 |
+
* WPForms is distributed in the hope that it will be useful,
|
18 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
* GNU General Public License for more details.
|
21 |
+
*
|
22 |
+
* You should have received a copy of the GNU General Public License
|
23 |
+
* along with WPForms. If not, see <http://www.gnu.org/licenses/>.
|
24 |
+
*
|
25 |
+
* @package WPForms
|
26 |
+
* @author WPForms
|
27 |
+
* @since 1.0.0
|
28 |
+
* @license GPL-2.0+
|
29 |
+
* @copyright Copyright (c) 2016, WPForms LLC
|
30 |
+
*/
|
31 |
+
|
32 |
+
// Exit if accessed directly
|
33 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
34 |
+
|
35 |
+
// Don't allow multiple versions to be active
|
36 |
+
if ( class_exists( 'WPForms' ) ) :
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Deactivate if WPForms already activated.
|
40 |
+
*
|
41 |
+
* @since 1.0.0
|
42 |
+
*/
|
43 |
+
function wpforms_deactivate() {
|
44 |
+
deactivate_plugins( plugin_basename( __FILE__ ) );
|
45 |
+
}
|
46 |
+
add_action( 'admin_init', 'wpforms_deactivate' );
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Display notice after deactivation.
|
50 |
+
*
|
51 |
+
* @since 1.0.0
|
52 |
+
*/
|
53 |
+
function wpforms_lite_notice() {
|
54 |
+
echo '<div class="notice notice-warning"><p>' . __( 'Please deactivate WPForms Lite before activating WPForms', 'wpforms' ) . '</p></div>';
|
55 |
+
if ( isset( $_GET['activate'] ) )
|
56 |
+
unset( $_GET['activate'] );
|
57 |
+
}
|
58 |
+
add_action( 'admin_notices', 'wpforms_lite_notice' );
|
59 |
+
|
60 |
+
else :
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Main WPForms class.
|
64 |
+
*
|
65 |
+
* @since 1.0.0
|
66 |
+
* @package WPForms
|
67 |
+
*/
|
68 |
+
final class WPForms {
|
69 |
+
|
70 |
+
/**
|
71 |
+
* One is the loneliest number that you'll ever do.
|
72 |
+
*
|
73 |
+
* @since 1.0.0
|
74 |
+
* @var object
|
75 |
+
*/
|
76 |
+
private static $instance;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Plugin version for enqueueing, etc.
|
80 |
+
*
|
81 |
+
* @since 1.0.0
|
82 |
+
* @var sting
|
83 |
+
*/
|
84 |
+
public $version = '1.3.1.1';
|
85 |
+
|
86 |
+
/**
|
87 |
+
* The form data handler instance.
|
88 |
+
*
|
89 |
+
* @var object WPForms_Form_Handler
|
90 |
+
* @since 1.0.0
|
91 |
+
*/
|
92 |
+
public $form;
|
93 |
+
|
94 |
+
/**
|
95 |
+
* The entry data handler instance (Pro).
|
96 |
+
*
|
97 |
+
* @var object WPForms_Entry_Handler
|
98 |
+
* @since 1.0.0
|
99 |
+
*/
|
100 |
+
public $entry;
|
101 |
+
|
102 |
+
/**
|
103 |
+
* The entry meta data handler instance (Pro).
|
104 |
+
*
|
105 |
+
* @var object WPForms_Entry_Meta_Handler
|
106 |
+
* @since 1.1.6
|
107 |
+
*/
|
108 |
+
public $entry_meta;
|
109 |
+
|
110 |
+
/**
|
111 |
+
* The front-end instance.
|
112 |
+
*
|
113 |
+
* @var object WPForms_Frontend
|
114 |
+
* @since 1.0.0
|
115 |
+
*/
|
116 |
+
public $frontend;
|
117 |
+
|
118 |
+
/**
|
119 |
+
* The process instance.
|
120 |
+
*
|
121 |
+
* @var object WPForms_Process
|
122 |
+
* @since 1.0.0
|
123 |
+
*/
|
124 |
+
public $process;
|
125 |
+
|
126 |
+
/**
|
127 |
+
* The smart tags instance.
|
128 |
+
*
|
129 |
+
* @var object WPForms_Smart_Tags
|
130 |
+
* @since 1.0.0
|
131 |
+
*/
|
132 |
+
public $smart_tags;
|
133 |
+
|
134 |
+
/**
|
135 |
+
* The Logging instance.
|
136 |
+
*
|
137 |
+
* @var object WPForms_Logging
|
138 |
+
* @since 1.0.0
|
139 |
+
*/
|
140 |
+
public $logs;
|
141 |
+
|
142 |
+
/**
|
143 |
+
* The Preview instance.
|
144 |
+
*
|
145 |
+
* @var object WPForms_Preview
|
146 |
+
* @since 1.1.9
|
147 |
+
*/
|
148 |
+
public $preview;
|
149 |
+
|
150 |
+
/**
|
151 |
+
* The License class instance (Pro).
|
152 |
+
*
|
153 |
+
* @var object WPForms_License
|
154 |
+
* @since 1.0.0
|
155 |
+
*/
|
156 |
+
public $license;
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Main WPForms Instance.
|
160 |
+
*
|
161 |
+
* Insures that only one instance of WPForms exists in memory at any one
|
162 |
+
* time. Also prevents needing to define globals all over the place.
|
163 |
+
*
|
164 |
+
* @since 1.0.0
|
165 |
+
* @return WPForms
|
166 |
+
*/
|
167 |
+
public static function instance() {
|
168 |
+
|
169 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPForms ) ) {
|
170 |
+
|
171 |
+
self::$instance = new WPForms;
|
172 |
+
self::$instance->constants();
|
173 |
+
self::$instance->load_textdomain();
|
174 |
+
self::$instance->includes();
|
175 |
+
|
176 |
+
// Load Pro or Lite specific files
|
177 |
+
if ( file_exists( WPFORMS_PLUGIN_DIR . 'pro/wpforms-pro.php' ) ) {
|
178 |
+
require_once WPFORMS_PLUGIN_DIR . 'pro/wpforms-pro.php';
|
179 |
+
} else {
|
180 |
+
require_once WPFORMS_PLUGIN_DIR . 'lite/wpforms-lite.php';
|
181 |
+
}
|
182 |
+
|
183 |
+
add_action( 'plugins_loaded', array( self::$instance, 'objects' ), 10 );
|
184 |
+
}
|
185 |
+
return self::$instance;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Include files.
|
190 |
+
*
|
191 |
+
* @since 1.0.0
|
192 |
+
*/
|
193 |
+
private function includes() {
|
194 |
+
|
195 |
+
// Global includes
|
196 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/functions.php';
|
197 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-install.php';
|
198 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-form.php';
|
199 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-fields.php';
|
200 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-frontend.php';
|
201 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-templates.php';
|
202 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-process.php';
|
203 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-smart-tags.php';
|
204 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-logging.php';
|
205 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-widget.php';
|
206 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/class-preview.php';
|
207 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/emails/class-emails.php';
|
208 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/integrations.php';
|
209 |
+
|
210 |
+
// Admin/Dashboard only includes
|
211 |
+
if ( is_admin() ) {
|
212 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/class-menu.php';
|
213 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/overview/class-overview.php';
|
214 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/builder/class-builder.php';
|
215 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/builder/functions.php';
|
216 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/class-welcome.php';
|
217 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/class-editor.php';
|
218 |
+
require_once WPFORMS_PLUGIN_DIR . 'includes/admin/ajax-actions.php';
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Setup objects.
|
224 |
+
*
|
225 |
+
* @since 1.0.0
|
226 |
+
*/
|
227 |
+
public function objects() {
|
228 |
+
|
229 |
+
// Global objects
|
230 |
+
$this->form = new WPForms_Form_Handler;
|
231 |
+
$this->frontend = new WPForms_Frontend;
|
232 |
+
$this->process = new WPForms_Process;
|
233 |
+
$this->smart_tags = new WPForms_Smart_Tags;
|
234 |
+
$this->logs = new WPForms_Logging;
|
235 |
+
$this->preview = new WPForms_Preview;
|
236 |
+
|
237 |
+
// Hook now that all of the WPForms stuff is loaded.
|
238 |
+
do_action( 'wpforms_loaded' );
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Setup plugin constants.
|
243 |
+
*
|
244 |
+
* @since 1.0.0
|
245 |
+
*/
|
246 |
+
private function constants() {
|
247 |
+
|
248 |
+
// Plugin version
|
249 |
+
if ( ! defined( 'WPFORMS_VERSION' ) ) {
|
250 |
+
define( 'WPFORMS_VERSION', $this->version );
|
251 |
+
}
|
252 |
+
|
253 |
+
// Plugin Folder Path
|
254 |
+
if ( ! defined( 'WPFORMS_PLUGIN_DIR' ) ) {
|
255 |
+
define( 'WPFORMS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
256 |
+
}
|
257 |
+
|
258 |
+
// Plugin Folder URL
|
259 |
+
if ( ! defined( 'WPFORMS_PLUGIN_URL' ) ) {
|
260 |
+
define( 'WPFORMS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
261 |
+
}
|
262 |
+
|
263 |
+
// Plugin Root File
|
264 |
+
if ( ! defined( 'WPFORMS_PLUGIN_FILE' ) ) {
|
265 |
+
define( 'WPFORMS_PLUGIN_FILE', __FILE__ );
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Loads the plugin language files.
|
271 |
+
*
|
272 |
+
* @since 1.0.0
|
273 |
+
*/
|
274 |
+
public function load_textdomain() {
|
275 |
+
|
276 |
+
load_plugin_textdomain( 'wpforms', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* The function which returns the one WPForms instance.
|
282 |
+
*
|
283 |
+
* Use this function like you would a global variable, except without needing
|
284 |
+
* to declare the global.
|
285 |
+
*
|
286 |
+
* Example: <?php $wpforms = wpforms(); ?>
|
287 |
+
*
|
288 |
+
* @since 1.0.0
|
289 |
+
* @return object
|
290 |
+
*/
|
291 |
+
function wpforms() {
|
292 |
+
|
293 |
+
return WPForms::instance();
|
294 |
+
}
|
295 |
+
wpforms();
|
296 |
+
|
297 |
+
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|