| @@ -101,60 +101,33 @@ | ||
| 101 | 101 | </p> |
| 102 | 102 | </div><!-- .postbox --> |
| 103 | 103 | |
| 104 | 104 | <?php |
| 105 | - // Importers. | |
| 106 | - foreach ( $importers as $importer ) { | |
| 105 | + // Mailchimp for WordPress (MC4WP). | |
| 106 | + if ( $mc4wp->has_forms_in_posts() && $mc4wp->has_forms() && $forms->exist() ) { | |
| 107 | 107 | ?> |
| 108 | - <div id="import-<?php echo esc_attr( $importer['name'] ); ?>" class="postbox"> | |
| 109 | - <h2> | |
| 110 | - <?php | |
| 111 | - printf( | |
| 112 | - /* translators: %s: Importer title */ | |
| 113 | - esc_html__( '%s: Migrate Configuration', 'convertkit' ), | |
| 114 | - esc_html( $importer['title'] ) | |
| 115 | - ); | |
| 116 | - ?> | |
| 117 | - </h2> | |
| 108 | + <div id="import-mc4wp" class="postbox"> | |
| 109 | + <h2><?php esc_html_e( 'MC4WP: Migrate Configuration', 'convertkit' ); ?></h2> | |
| 118 | 110 | |
| 119 | 111 | <p class="description"> |
| 120 | - <?php | |
| 121 | - if ( ! empty( $importer['description'] ) ) { | |
| 122 | - echo esc_html( $importer['description'] ); | |
| 123 | - } else { | |
| 124 | - printf( | |
| 125 | - /* translators: %s: Importer title */ | |
| 126 | - esc_html__( 'Automatically replace %s form shortcodes and blocks with Kit form shortcodes and blocks.', 'convertkit' ), | |
| 127 | - esc_html( $importer['title'] ) | |
| 128 | - ); | |
| 129 | - } | |
| 130 | - ?> | |
| 131 | - <br /> | |
| 112 | + <?php esc_html_e( 'Automatically replace MC4WP form shortcodes with Kit forms.', 'convertkit' ); ?><br /> | |
| 132 | 113 | </p> |
| 133 | 114 | |
| 134 | 115 | <table class="widefat striped"> |
| 135 | 116 | <thead> |
| 136 | 117 | <tr> |
| 137 | - <th> | |
| 138 | - <?php | |
| 139 | - printf( | |
| 140 | - /* translators: %s: Importer title */ | |
| 141 | - esc_html__( '%s Form', 'convertkit' ), | |
| 142 | - esc_html( $importer['title'] ) | |
| 143 | - ); | |
| 144 | - ?> | |
| 145 | - </th> | |
| 118 | + <th><?php esc_html_e( 'MC4WP Form', 'convertkit' ); ?></th> | |
| 146 | 119 | <th><?php esc_html_e( 'Kit Form', 'convertkit' ); ?></th> |
| 147 | 120 | </tr> |
| 148 | 121 | </thead> |
| 149 | 122 | <tbody> |
| 150 | 123 | <?php |
| 151 | - foreach ( $importer['forms'] as $importer_form_id => $importer_form_title ) { | |
| 124 | + foreach ( $mc4wp->get_forms() as $mc4wp_form_id => $mc4wp_form_title ) { | |
| 152 | 125 | ?> |
| 153 | 126 | <tr> |
| 154 | - <td><?php echo esc_html( $importer_form_title ); ?></td> | |
| 127 | + <td><?php echo esc_html( $mc4wp_form_title ); ?></td> | |
| 155 | 128 | <td> |
| 156 | - <select name="_wp_convertkit_integration_<?php echo esc_attr( $importer['name'] ); ?>_settings[<?php echo esc_attr( $importer_form_id ); ?>]"> | |
| 129 | + <select name="_wp_convertkit_integration_mc4wp_settings[<?php echo esc_attr( $mc4wp_form_id ); ?>]"> | |
| 157 | 130 | <?php |
| 158 | 131 | foreach ( $forms->get() as $form ) { |
| 159 | 132 | ?> |
| 160 | 133 | <option value="<?php echo esc_attr( $form['id'] ); ?>"><?php echo esc_html( $form['name'] ); ?></option> |
| @@ -174,9 +147,9 @@ | ||
| 174 | 147 | <?php |
| 175 | 148 | submit_button( |
| 176 | 149 | __( 'Migrate', 'convertkit' ), |
| 177 | 150 | 'primary', |
| 178 | - 'convertkit-import-' . $importer['name'], | |
| 151 | + 'convertkit-import-mc4wp', | |
| 179 | 152 | false |
| 180 | 153 | ); |
| 181 | 154 | ?> |
| 182 | 155 | </p> |