PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.0.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.0.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
← All changes | includes/class-convertkit-ajax.php +4 -4 2.2.42.0.3 View file →
@@ -166,22 +166,22 @@
166 166 if ( is_wp_error( $subscriber ) ) {
167 167 wp_send_json_error( $subscriber->get_error_message() );
168 168 }
169 169
170 - // Extract the subscriber's email.
171 - $email = $subscriber['email_address'];
172 -
173 170 // Store the subscriber ID as a cookie.
174 171 $subscriber = new ConvertKit_Subscriber();
175 172 $subscriber->set( $subscriber_id );
176 173
177 174 // Tag the subscriber with the Post's tag.
178 - $tag = $api->tag_subscribe( $tag_id, $email );
175 + $tag = $api->tag_subscribe( $tag_id, $subscriber['email_address'] );
179 176
180 177 // Bail if an error occured tagging the subscriber.
181 178 if ( is_wp_error( $tag ) ) {
182 179 wp_send_json_error( $tag );
183 180 }
181 +
182 + // Store the subscriber ID as a cookie.
183 + setcookie( 'ck_subscriber_id', $subscriber['id'], time() + ( 365 * DAY_IN_SECONDS ), '/' );
184 184
185 185 wp_send_json_success( $tag );
186 186
187 187 }