PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.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 | views/frontend/restrict-content/login-email.php +22 -2 3.4.23.4.3 View file →
@@ -7,13 +7,33 @@
7 7 * @package ConvertKit
8 8 * @author ConvertKit
9 9 */
10 10
11 +// Resource type and ID aren't defined when the Member Content Login block is used.
12 +$resource_type = ( isset( $resource_type ) ? $resource_type : '' );
13 +$resource_id = ( isset( $resource_id ) ? $resource_id : 0 );
11 14 ?>
12 15 <form id="convertkit-restrict-content-form" class="convertkit-restrict-content-form" action="<?php echo esc_attr( add_query_arg( array( 'convertkit_login' => 1 ), get_permalink( $post_id ) ) ); ?>#convertkit-restrict-content" method="post">
13 16 <div id="convertkit-restrict-content-email-field" class="<?php echo sanitize_html_class( ( is_wp_error( WP_ConvertKit()->get_class( 'output_restrict_content' )->error ) ? 'convertkit-restrict-content-error' : '' ) ); ?>">
14 17 <input type="email" name="convertkit_email" id="convertkit_email" value="" placeholder="<?php esc_attr_e( 'Email Address', 'convertkit' ); ?>" required />
15 - <input type="submit" class="wp-block-button__link wp-block-button__link" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_button_label' ) ); ?>" />
18 + <?php
19 + // Output the submit button. If a spam protection provider is active
20 + // it renders the button plus any accompanying widget div; otherwise a
21 + // plain submit button is output.
22 + $spam = new ConvertKit_Spam_Protection();
23 + $spam_provider = $spam->get_active_provider();
24 + if ( $spam_provider !== false ) {
25 + echo $spam_provider->get_submit_button_html( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
26 + WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_button_label' ),
27 + 'convertkit_member_content_login',
28 + array( 'wp-block-button__link', 'wp-block-button__link' )
29 + );
30 + } else {
31 + ?>
32 + <input type="submit" class="wp-block-button__link wp-block-button__link" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_button_label' ) ); ?>" />
33 + <?php
34 + }
35 + ?>
16 36 <input type="hidden" name="convertkit_resource_type" value="<?php echo esc_attr( $resource_type ); ?>" />
17 37 <input type="hidden" name="convertkit_resource_id" value="<?php echo esc_attr( $resource_id ); ?>" />
18 38 <input type="hidden" name="convertkit_post_id" value="<?php echo esc_attr( $post_id ); ?>" />
19 39 <?php wp_nonce_field( 'convertkit_restrict_content_login' ); ?>
@@ -24,5 +44,5 @@
24 44 // Output notices.
25 45 require 'notices.php';
26 46 ?>
27 47
28 -<small><?php echo esc_html( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_description_text' ) ); ?></small>
48 +<small><?php echo esc_html( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_description_text' ) ); ?></small>