| 1 |
<?php |
| 2 |
/** |
| 3 |
* Outputs the restricted content product message, |
| 4 |
* and a form for the subscriber to enter their |
| 5 |
* email address if they've already subscribed |
| 6 |
* to the ConvertKit Product. |
| 7 |
* |
| 8 |
* @package ConvertKit |
| 9 |
* @author ConvertKit |
| 10 |
*/ |
| 11 |
|
| 12 |
?> |
| 13 |
|
| 14 |
<div id="convertkit-restrict-content"> |
| 15 |
<h3><?php echo esc_html( $this->restrict_content_settings->get_by_key( 'subscribe_heading' ) ); ?></h3> |
| 16 |
<p> |
| 17 |
<?php |
| 18 |
foreach ( explode( "\n", $this->restrict_content_settings->get_by_key( 'subscribe_text' ) ) as $text_line ) { |
| 19 |
echo esc_html( $text_line ) . '<br />'; |
| 20 |
} |
| 21 |
?> |
| 22 |
</p> |
| 23 |
|
| 24 |
<?php |
| 25 |
echo $button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 26 |
|
| 27 |
// If scripts are disabled in the Plugin's settings, output the email login form now. |
| 28 |
if ( $this->settings->scripts_disabled() ) { |
| 29 |
?> |
| 30 |
<p> |
| 31 |
<?php echo esc_html( $this->restrict_content_settings->get_by_key( 'email_text' ) ); ?> |
| 32 |
</p> |
| 33 |
<?php |
| 34 |
require 'product-email.php'; |
| 35 |
} else { |
| 36 |
// Just output the paragraph with a link to login, which will trigger the modal to display. |
| 37 |
?> |
| 38 |
<p> |
| 39 |
<?php echo esc_html( $this->restrict_content_settings->get_by_key( 'email_text' ) ); ?> |
| 40 |
<a href="#" class="convertkit-restrict-content-modal-open"><?php echo esc_attr( $this->restrict_content_settings->get_by_key( 'email_button_label' ) ); ?></a> |
| 41 |
</p> |
| 42 |
<?php |
| 43 |
} |
| 44 |
?> |
| 45 |
</div> |
| 46 |
|