admin
10 years ago
emails
10 years ago
fields
10 years ago
templates
10 years ago
class-fields.php
10 years ago
class-form.php
10 years ago
class-frontend.php
10 years ago
class-install.php
10 years ago
class-logging.php
10 years ago
class-process.php
10 years ago
class-smart-tags.php
10 years ago
class-templates.php
10 years ago
class-widget.php
10 years ago
functions.php
10 years ago
class-fields.php
66 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Load the field types. |
| 4 | * |
| 5 | * @package WPForms |
| 6 | * @author WPForms |
| 7 | * @since 1.0.0 |
| 8 | * @license GPL-2.0+ |
| 9 | * @copyright Copyright (c) 2016, WPForms LLC |
| 10 | */ |
| 11 | class WPForms_Fields { |
| 12 | |
| 13 | /** |
| 14 | * Primary class constructor. |
| 15 | * |
| 16 | * @since 1.0.0 |
| 17 | */ |
| 18 | public function __construct() { |
| 19 | |
| 20 | $this->load(); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Load default field types. |
| 25 | * |
| 26 | * @since 1.0.0 |
| 27 | */ |
| 28 | public function load() { |
| 29 | |
| 30 | // Parent class template |
| 31 | require_once WPFORMS_PLUGIN_DIR . 'includes/fields/class-base.php'; |
| 32 | |
| 33 | $fields = apply_filters( 'wpforms_load_fields', array( |
| 34 | 'text', |
| 35 | 'textarea', |
| 36 | 'select', |
| 37 | 'radio', |
| 38 | 'checkbox', |
| 39 | 'divider', |
| 40 | 'email', |
| 41 | 'url', |
| 42 | 'hidden', |
| 43 | 'html', |
| 44 | 'name', |
| 45 | 'password', |
| 46 | 'address', |
| 47 | 'phone', |
| 48 | 'date-time', |
| 49 | 'number', |
| 50 | 'page-break', |
| 51 | 'file-upload', |
| 52 | 'payment-single', |
| 53 | 'payment-multiple', |
| 54 | 'payment-credit-card', |
| 55 | 'payment-total', |
| 56 | ) ); |
| 57 | |
| 58 | foreach ( $fields as $field ) { |
| 59 | |
| 60 | if ( file_exists( WPFORMS_PLUGIN_DIR . 'includes/fields/class-' . $field . '.php' ) ) { |
| 61 | require_once WPFORMS_PLUGIN_DIR . 'includes/fields/class-' . $field . '.php'; |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | new WPForms_Fields; |