Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions includes/reader-activation/class-reader-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ private static function get_settings_config() {
'sender_name' => Emails::get_from_name(),
'sender_email_address' => Emails::get_from_email(),
'contact_email_address' => Emails::get_reply_to_email(),
'auth_modal_text' => [
'sign_up' => '',
'sign_in_password_below' => '',
'sign_in_otp_below' => '',
],
];

/**
Expand Down Expand Up @@ -1089,6 +1094,22 @@ public static function render_honeypot_field( $placeholder = '' ) {
<?php
}

/**
* Render auth form auxiliary text.
*
* @param string $key The key for the text.
*/
public static function render_auth_form_auxiliary_text( $key ) {
$auth_modal_text = self::get_setting( 'auth_modal_text' );
if ( ! empty( $auth_modal_text[ $key ] ) ) {
// Unwrap the text from p tags, which would prevent it from rendering in another p tag.
$auth_modal_text[ $key ] = preg_replace( '/^<p>(.*)<\/p>$/', '$1', $auth_modal_text[ $key ] );
?>
<span style="display: block; margin: 10px 0;"><?php echo wp_kses_post( $auth_modal_text[ $key ] ); ?></span>
<?php
}
}

/**
* Renders reader authentication form.
*
Expand Down Expand Up @@ -1194,6 +1215,7 @@ public static function render_auth_form( $is_inline = false ) {
)
);
?>
<?php self::render_auth_form_auxiliary_text( 'sign_in_password_below' ); ?>
</p>
<p data-action="link">
<?php
Expand All @@ -1205,6 +1227,7 @@ public static function render_auth_form( $is_inline = false ) {
)
);
?>
<?php self::render_auth_form_auxiliary_text( 'sign_in_otp_below' ); ?>
</p>
<p data-action="otp">
<?php
Expand All @@ -1220,6 +1243,7 @@ public static function render_auth_form( $is_inline = false ) {
<input type="hidden" name="redirect" value="<?php echo \esc_attr( $redirect ); ?>" />
<?php if ( isset( $lists ) && ! empty( $lists ) ) : ?>
<div data-action="register">
<?php self::render_auth_form_auxiliary_text( 'sign_up' ); ?>
<?php if ( 1 < count( $lists ) ) : ?>
<p><?php echo \esc_html( $newsletters_label ); ?></p>
<?php endif; ?>
Expand Down
Loading