8
8
9
9
abstract class MC4WP_Integration {
10
10
11
- protected $ checkbox_name_value = '_mc4wp_subscribe ' ;
12
-
11
+ /**
12
+ * @var string
13
+ */
13
14
protected $ type = 'integration ' ;
14
15
15
16
/**
@@ -27,7 +28,7 @@ public function checkbox_was_checked() {
27
28
return false ;
28
29
}
29
30
30
- return ( isset ( $ _POST [ $ this -> checkbox_name_value ] ) && $ _POST [ $ this -> checkbox_name_value ] == 1 );
31
+ return ( isset ( $ _POST [ ' _mc4wp_subscribe ' ] ) && $ _POST [ ' _mc4wp_subscribe ' ] == 1 );
31
32
}
32
33
33
34
/**
@@ -83,7 +84,7 @@ public function get_checkbox( $args = array() ) {
83
84
// checkbox
84
85
$ content .= '<p id="mc4wp-checkbox"> ' ;
85
86
$ content .= '<label> ' ;
86
- $ content .= '<input type="checkbox" name=" ' . esc_attr ( $ this -> checkbox_name_value ) . ' " value="1" ' . $ checked . ' /> ' ;
87
+ $ content .= '<input type="checkbox" name="_mc4wp_subscribe " value="1" ' . $ checked . ' /> ' ;
87
88
$ content .= $ label ;
88
89
$ content .= '</label> ' ;
89
90
$ content .= '</p> ' ;
@@ -140,11 +141,11 @@ protected function subscribe( $email, array $merge_vars = array(), $signup_type
140
141
141
142
if ( empty ( $ lists ) ) {
142
143
if ( ( ! defined ( 'DOING_AJAX ' ) || ! DOING_AJAX ) && current_user_can ( 'manage_options ' ) ) {
143
- wp_die ('
144
- <h3>MailChimp for WP - Error</h3>
145
- <p>Please select a list to subscribe to in the <a href=" ' . admin_url ( 'admin.php?page=mc4wp-checkbox-settings ' ) .'">checkbox settings</a>.</p>
146
- <p style="font-style:italic; font-size:12px;">This message is only visible to administrators for debugging purposes.</p>
147
- ', ' Error - MailChimp for WP ' , array ( 'back_link ' => true ) );
144
+ wp_die (
145
+ ' <h3>MailChimp for WP - Error</h3>
146
+ <p>Please select a list to subscribe to in the <a href=" ' . admin_url ( 'admin.php?page=mc4wp-lite- checkbox-settings ' ) .'">checkbox settings</a>.</p>
147
+ <p style="font-style:italic; font-size:12px;">This message is only visible to administrators for debugging purposes.</p> ' ,
148
+ 'Error - MailChimp for WP ' , array ( 'back_link ' => true ) );
148
149
}
149
150
150
151
return 'no_lists_selected ' ;
@@ -169,7 +170,7 @@ protected function subscribe( $email, array $merge_vars = array(), $signup_type
169
170
do_action ( 'mc4wp_before_subscribe ' , $ email , $ merge_vars );
170
171
171
172
foreach ( $ lists as $ list_id ) {
172
- $ result = $ api ->subscribe ( $ list_id , $ email , $ merge_vars , $ email_type , $ opts ['double_optin ' ], false , true , $ opts [ ' send_welcome ' ] );
173
+ $ result = $ api ->subscribe ( $ list_id , $ email , $ merge_vars , $ email_type , $ opts ['double_optin ' ], false , true );
173
174
}
174
175
175
176
do_action ( 'mc4wp_after_subscribe ' , $ email , $ merge_vars , $ result );
0 commit comments