admin
7 years ago
analytics
7 years ago
emails
7 years ago
fields
7 years ago
providers
7 years ago
templates
7 years ago
class-conditional-logic-core.php
7 years ago
class-fields.php
7 years ago
class-form.php
7 years ago
class-frontend.php
7 years ago
class-install.php
9 years ago
class-logging.php
7 years ago
class-preview.php
7 years ago
class-process.php
7 years ago
class-providers.php
8 years ago
class-smart-tags.php
7 years ago
class-templates.php
8 years ago
class-widget.php
7 years ago
functions.php
7 years ago
integrations.php
7 years ago
class-providers.php
61 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Load the providers. |
| 5 | * |
| 6 | * @package WPForms |
| 7 | * @author WPForms |
| 8 | * @since 1.3.6 |
| 9 | * @license GPL-2.0+ |
| 10 | * @copyright Copyright (c) 2017, WPForms LLC |
| 11 | */ |
| 12 | class WPForms_Providers { |
| 13 | |
| 14 | /** |
| 15 | * Primary class constructor. |
| 16 | * |
| 17 | * @since 1.3.6 |
| 18 | */ |
| 19 | public function __construct() { |
| 20 | |
| 21 | $this->init(); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Load and init the base provider class. |
| 26 | * |
| 27 | * @since 1.3.6 |
| 28 | */ |
| 29 | public function init() { |
| 30 | |
| 31 | // Parent class template. |
| 32 | require_once WPFORMS_PLUGIN_DIR . 'includes/providers/class-base.php'; |
| 33 | |
| 34 | // Load default templates on WP init. |
| 35 | add_action( 'wpforms_loaded', array( $this, 'load' ) ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Load default marketing providers. |
| 40 | * |
| 41 | * @since 1.3.6 |
| 42 | */ |
| 43 | public function load() { |
| 44 | |
| 45 | $providers = array( |
| 46 | 'constant-contact', |
| 47 | ); |
| 48 | |
| 49 | $providers = apply_filters( 'wpforms_load_providers', $providers ); |
| 50 | |
| 51 | foreach ( $providers as $provider ) { |
| 52 | |
| 53 | $provider = sanitize_file_name( $provider ); |
| 54 | |
| 55 | require_once WPFORMS_PLUGIN_DIR . 'includes/providers/class-' . $provider . '.php'; |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | new WPForms_Providers; |
| 61 |