uo_ld_group_signup_joined_message
Filters the success message displayed after a user joins a group in LearnDash.
add_filter( 'uo_ld_group_signup_joined_message', $callback, 10, 1 );
Description
Filters the success message displayed after a user joins a LearnDash group. Developers can modify this message to customize the user experience or add dynamic content based on the group ID. This hook fires after a successful group signup process.
Usage
add_filter( 'uo_ld_group_signup_joined_message', 'your_function_name', 10, 1 );
Parameters
-
$group_post_id(mixed) - This parameter contains the default success message displayed to a user after they join a group.
Return Value
The filtered value.
Examples
/**
* Filter to modify the default message displayed when a user successfully joins a group.
*
* This example adds a prefix to the default message if the user is a
* premium member.
*
* @param string $message The default success message.
* @param int $group_post_id The ID of the group the user joined.
* @return string The modified success message.
*/
add_filter( 'uo_ld_group_signup_joined_message', function( $message, $group_post_id ) {
// Check if the current user is a premium member.
// Replace this with your actual check for premium membership.
if ( current_user_can( 'premium_member' ) ) {
// Add a prefix for premium members.
$message = sprintf(
esc_html__( 'Premium Member: %s', 'your-text-domain' ),
$message
);
}
return $message;
}, 10, 2 );
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/single-group.php:138
<?php
if ( isset( $_REQUEST['msg'] ) && $_REQUEST['msg'] === '2' ) {
echo wp_kses_post( apply_filters( 'uo_ld_group_signup_joined_remove_previous_group_message',
esc_html__( 'Congratulations! You have successfully joined the new group and have been removed from the previous group.', 'uncanny-pro-toolkit' ),
$group_post_id
) );
} else {
echo wp_kses_post( apply_filters( 'uo_ld_group_signup_joined_message',
esc_html__( 'Congratulations! You are now a member of this group.', 'uncanny-pro-toolkit' ),
$group_post_id
) );
}
?>
</p>
<?php