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