Filter uncanny-toolkit-pro

uo_ld_group_signup_joined_remove_previous_group_message

Filters the success message displayed when a user is removed from a previous group and joins a new one.

add_filter( 'uo_ld_group_signup_joined_remove_previous_group_message', $callback, 10, 1 );

Description

Filters the success message displayed when a user joins a new LearnDash group and is removed from a previous one. Developers can modify this message to customize user feedback, for example, to include dynamic group names or other relevant information.


Usage

add_filter( 'uo_ld_group_signup_joined_remove_previous_group_message', 'your_function_name', 10, 1 );

Parameters

$group_post_id (mixed)
This parameter holds the message displayed to the user when they successfully join a new group and are removed from a previous one.

Return Value

The filtered value.


Examples

/**
 * Filters the message displayed when a user joins a new group and is removed from a previous one.
 *
 * This function demonstrates how to modify the default success message.
 *
 * @param string $message       The default message.
 * @param int    $group_post_id The ID of the group the user has joined.
 * @return string The modified or original message.
 */
function my_custom_uo_ld_group_signup_joined_remove_previous_group_message( $message, $group_post_id ) {
	// You can add custom logic here. For example, check the group ID and tailor the message.
	// For this example, we'll just append a small note to the default message if the group ID is 123.
	if ( $group_post_id === 123 ) {
		$message .= ' ' . __( 'Welcome to the VIP section!', 'your-text-domain' );
	}

	// Always return the message, whether modified or not.
	return $message;
}
add_filter( 'uo_ld_group_signup_joined_remove_previous_group_message', 'my_custom_uo_ld_group_signup_joined_remove_previous_group_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:133

) ); ?></p>
										<?php
									} elseif ( is_user_logged_in() && isset( $_REQUEST['joined'] ) ) {
										?>
										<p>
											<?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


Scroll to Top