Changeset 2466186
- Timestamp:
- 02/01/2021 07:14:38 AM (5 years ago)
- Location:
- add-on-contact-form-7-mailpoet/trunk
- Files:
-
- 5 edited
-
add-on-contact-form-7-mailpoet.php (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
includes/class-mailpoet-cf7-integration.php (modified) (1 diff)
-
includes/class-mailpoet-cf7-submit-form.php (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
add-on-contact-form-7-mailpoet/trunk/add-on-contact-form-7-mailpoet.php
r2455527 r2466186 3 3 * Plugin Name: Add-on Contact Form 7 - Mailpoet 3 4 4 * Description: Add a MailPoet 3 signup field to your Contact Form 7 forms. 5 * Version: 1.3.1 55 * Version: 1.3.16 6 6 * Author: Tikweb 7 7 * Author URI: http://www.tikweb.dk/ -
add-on-contact-form-7-mailpoet/trunk/changelog.txt
r2455527 r2466186 1 1 == Changelog == 2 = 1.3.16 - 2021-01-29 = 3 * Using mailpoetsignup & mpconsent at a time related issues fixed. 4 2 5 = 1.3.15 - 2021-01-07 = 3 6 * Fixed error created by a debug file. -
add-on-contact-form-7-mailpoet/trunk/includes/class-mailpoet-cf7-integration.php
r2455527 r2466186 120 120 121 121 if ( ! $tag->has_option( 'subscriber-choice' ) ) { 122 $atts['value'] = ( $list_array ) ? implode( ',', $list_array) : '0';122 $atts['value'] = ( $list_array ) ? implode(',', $list_array) : '0'; 123 123 } 124 124 -
add-on-contact-form-7-mailpoet/trunk/includes/class-mailpoet-cf7-submit-form.php
r2455527 r2466186 85 85 //Check this form has mailpoet tag and email field is not empty and also checking the tag name 86 86 $has_mailpoet_tag = false; 87 $has_mailpoetsignup_tag = false; 88 $has_mpconsent_tag = false; 87 89 $mailpoet_tag_name = ''; 88 90 if ( isset( $field_names['mailpoetsignup'] ) && ! empty( $field_names['mailpoetsignup'] ) && is_array( $field_names['mailpoetsignup'] ) ) { 89 91 $has_mailpoet_tag = true; 92 $has_mailpoetsignup_tag = true; 90 93 $mailpoet_tag_name='mailpoetsignup'; 94 91 95 } 92 96 93 97 if ( isset( $field_names['mpconsent'] ) && ! empty( $field_names['mpconsent'] ) && is_array( $field_names['mpconsent'] ) ) { 94 98 $has_mailpoet_tag = true; 99 $has_mpconsent_tag = true; 95 100 $mailpoet_tag_name='mpconsent'; 96 101 } … … 137 142 } 138 143 144 145 139 146 //Save all list 140 147 $list_ids = array(); 141 148 142 149 //Checking the tag name 143 if ($mailpoet_tag_name == 'mailpoetsignup' ) {150 if ($mailpoet_tag_name == 'mailpoetsignup' || $has_mailpoetsignup_tag) { 144 151 //Get all the form tags 145 152 foreach ( $form_tags as $FormTag ) { … … 161 168 } 162 169 } 163 164 170 //Get the new list ids from hidden form 165 171 $new_list_ids = $form_data['fieldVal']; … … 168 174 169 175 $list_ids = array_merge( $list_ids, $current_list ); 176 170 177 } 171 178 } … … 175 182 } 176 183 } 177 elseif ($mailpoet_tag_name == 'mpconsent' ) {184 elseif ($mailpoet_tag_name == 'mpconsent' || $has_mpconsent_tag) { 178 185 //collecting the lists 179 186 $lists = \MailPoet\API\API::MP('v1')->getLists(); … … 212 219 'status' => $signup_confirm_state, 213 220 ); 221 214 222 215 223 #If custom field presents, append the fields value to subscribe data … … 237 245 //Saving new subscriber 238 246 try { 239 $subscriber = \MailPoet\API\API::MP( 'v1' )->addSubscriber( $subscribe_data, 240 array_unique( $list_ids ), $options ); 247 $subscriber = \MailPoet\API\API::MP( 'v1' )->addSubscriber( $subscribe_data, array_unique( $list_ids ), $options ); 241 248 } catch ( Exception $exception ) { 242 249 … … 250 257 try { 251 258 //If 'mpconsent' form active it will add all lists. 252 if ($ mailpoet_tag_name == 'mpconsent') {259 if ($has_mpconsent_tag && !$has_mailpoetsignup_tag) { 253 260 $current_list = $list_ids ; 254 261 } … … 263 270 } 264 271 } 265 266 267 272 } 268 273 -
add-on-contact-form-7-mailpoet/trunk/readme.txt
r2455527 r2466186 6 6 Tested up to: 5.5.1 7 7 Requires PHP: 7.0 8 Stable tag: 1.3.1 58 Stable tag: 1.3.16 9 9 10 10 Add a MailPoet 3 signup field to your Contact Form 7 forms.
Note: See TracChangeset
for help on using the changeset viewer.