PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.5
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.5
3.4.5 3.4.4 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 All 198 releases
← All changes | includes/blocks/class-convertkit-block-member-content-login.php +9 -13 3.4.4 → 3.4.5 View file →
@@ -356,12 +356,15 @@
356 356
357 357 // Enqueue CSS and JS.
358 358 $output_restrict_content->enqueue_scripts_and_styles();
359 359
360 - // If the subscriber is logged in, output the log out button.
360 + // Get the subscriber ID, if the subscriber is logged in.
361 361 $subscriber = new ConvertKit_Subscriber();
362 362 $subscriber_id = $subscriber->get_subscriber_id();
363 +
364 + ob_start();
363 365 if ( ! is_wp_error( $subscriber_id ) && $subscriber_id ) {
366 + // If the subscriber is logged in, output the log out button.
364 367 $logout_url = add_query_arg(
365 368 array(
366 369 'convertkit_logout' => 1,
367 370 '_wpnonce' => wp_create_nonce( 'convertkit_member_content_logout' ),
@@ -368,23 +371,16 @@
368 371 ),
369 372 get_permalink( $post_id )
370 373 );
371 374
372 - ob_start();
373 375 include CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/member-content-logged-in.php';
374 - return trim( ob_get_clean() );
375 - }
376 -
377 - // If the subscriber submitted their email address, output the code form.
378 - if ( $output_restrict_content->token !== false ) {
379 - ob_start();
376 + } elseif ( $output_restrict_content->token !== false ) {
377 + // If the subscriber submitted their email address, output the code form.
380 378 include CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/code.php';
381 - return trim( ob_get_clean() );
379 + } else {
380 + // Output the login form.
381 + include CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/member-content-login.php';
382 382 }
383 -
384 - // Output.
385 - ob_start();
386 - include CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/member-content-login.php';
387 383 $html = trim( ob_get_clean() );
388 384
389 385 /**
390 386 * Filter the block's content immediately before it is output.