tml_register_passmail_template_message
Filters the registration confirmation email message sent to users.
add_filter( 'tml_register_passmail_template_message', $callback, 10, 1 );
Description
Filters the message displayed on the registration confirmation page. Developers can modify this text to provide custom instructions or information to users after they complete the registration process.
Usage
add_filter( 'tml_register_passmail_template_message', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
<?php
/**
* Modify the registration confirmation message.
*
* This callback function changes the default registration confirmation message
* to be more specific, indicating that a confirmation email will be sent
* and providing instructions on how to check their inbox.
*
* @param string $message The original registration confirmation message.
* @return string The modified registration confirmation message.
*/
add_filter( 'tml_register_passmail_template_message', 'my_custom_registration_confirmation_message', 10, 1 );
function my_custom_registration_confirmation_message( $message ) {
// Check if the message is the default one before modifying it,
// to avoid unintended changes if other plugins modify it first.
if ( $message === esc_html__( 'Registration confirmation will be e-mailed to you.', 'uncanny-learndash-codes' ) ) {
// Construct a new message with more specific instructions.
$new_message = sprintf(
/* translators: %s: Email address where confirmation will be sent. */
esc_html__( 'A confirmation email has been sent to your inbox. Please check your email to complete your registration.', 'my-text-domain' )
);
return $new_message;
}
// If it's not the default message, return it as is.
return $message;
}
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/templates/register-form.php:101
class="input"
<?php if ( 1 === intval( $required_field ) ) { ?>required="required"<?php } ?>
placeholder="<?php echo esc_html__( 'Registration Code', 'uncanny-learndash-groups' ); ?>"
value="<?php $template->the_posted_value( 'code_registration' ); ?>" size="20"/>
</p>
<?php } ?>
<p class="tml-registration-confirmation"
id="reg_passmail<?php $template->the_instance(); ?>"><?php echo apply_filters( 'tml_register_passmail_template_message', __( 'Registration confirmation will be e-mailed to you.', 'uncanny-learndash-groups' ) ); ?></p>
<?php do_action( 'register_form' ); ?>
<p class="tml-submit-wrap">
<input type="submit" name="wp-submit" class="btn btn-default"
id="wp-submit<?php $template->the_instance(); ?>"
value="<?php esc_attr_e( 'Register', 'uncanny-learndash-groups' ); ?>"/>
<input type="hidden" name="redirect_to" value="<?php $template->the_redirect_url( 'register' ); ?>"/>