PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
convertkit / admin / importers / class-convertkit-admin-importer-activecampaign.php

class-convertkit-admin-importer-activecampaign.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.4.3, at admin/importers/class-convertkit-admin-importer-activecampaign.php

116 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * ConvertKit Admin Importer ActiveCampaign class.
4 *
5 * @package ConvertKit
6 * @author ConvertKit
7 */
8
9 /**
10 * Import and migrate data from ActiveCampaign to Kit.
11 *
12 * @package ConvertKit
13 * @author ConvertKit
14 */
15 class ConvertKit_Admin_Importer_ActiveCampaign extends ConvertKit_Admin_Importer {
16
17 /**
18 * Holds the programmatic name of the importer (lowercase, no spaces).
19 *
20 * @since 3.1.7
21 *
22 * @var string
23 */
24 public $name = 'activecampaign';
25
26 /**
27 * Holds the title of the importer (for display in the importer list).
28 *
29 * @since 3.1.7
30 *
31 * @var string
32 */
33 public $title = 'ActiveCampaign';
34
35 /**
36 * Holds the shortcode name for ActiveCampaign forms.
37 *
38 * @since 3.1.7
39 *
40 * @var string
41 */
42 public $shortcode_name = 'activecampaign';
43
44 /**
45 * Holds the ID attribute name for ActiveCampaign forms.
46 *
47 * @since 3.1.7
48 *
49 * @var string
50 */
51 public $shortcode_id_attribute = 'form';
52
53 /**
54 * Holds the block name for ActiveCampaign forms.
55 *
56 * @since 3.1.7
57 *
58 * @var string
59 */
60 public $block_name = 'activecampaign-form/activecampaign-form-block';
61
62 /**
63 * Holds the ID attribute name for ActiveCampaign forms.
64 *
65 * @since 3.1.7
66 *
67 * @var string
68 */
69 public $block_id_attribute = 'formId';
70
71 /**
72 * Constructor
73 *
74 * @since 3.1.7
75 */
76 public function __construct() {
77
78 // Register this as an importer, if ActiveCampaign forms exist.
79 add_filter( 'convertkit_get_form_importers', array( $this, 'register' ) );
80
81 }
82
83 /**
84 * Returns an array of ActiveCampaign form IDs and titles.
85 *
86 * @since 3.1.7
87 *
88 * @return array
89 */
90 public function get_forms() {
91
92 // Forms are cached in the Plugin Settings.
93 $settings = get_option( 'settings_activecampaign' );
94
95 // Bail if the ActiveCampaign Plugin Settings are not set.
96 if ( ! $settings ) {
97 return array();
98 }
99
100 // Bail if the ActiveCampaign Forms are not set.
101 if ( ! array_key_exists( 'forms', $settings ) ) {
102 return array();
103 }
104
105 // Build array of forms.
106 $forms = array();
107 foreach ( $settings['forms'] as $form ) {
108 $forms[ $form['id'] ] = $form['name'];
109 }
110
111 return $forms;
112
113 }
114
115 }
116