Action uncanny-learndash-groups

ulgm_after_add_bulk_users_columns

Fires after bulk users are added to a group, providing the group ID for further actions.

add_action( 'ulgm_after_add_bulk_users_columns', $callback, 10, 1 );

Description

Fires after the "Add Bulk Users" table columns are displayed. Developers can use this hook to add custom columns or modify existing ones within the bulk user addition interface. The current managed group ID is provided for context.


Usage

add_action( 'ulgm_after_add_bulk_users_columns', 'your_function_name', 10, 1 );

Parameters

$ulgm_current_managed_group_id (mixed)
This parameter holds the ID of the currently managed group where users are being added.

Examples

<?php
/**
 * Example function to hook into ulgm_after_add_bulk_users_columns.
 * This function might be used to add custom columns or modify the output
 * after the default bulk user addition columns are rendered.
 *
 * @param int|string $ulgm_current_managed_group_id The ID of the currently managed group.
 */
function my_custom_ulgm_after_add_bulk_users_columns( $ulgm_current_managed_group_id ) {
    // Example: Log the group ID for debugging purposes.
    // In a real scenario, you might add a custom column here,
    // perform some checks based on the group ID, or integrate with other plugins.
    error_log( 'ulgm_after_add_bulk_users_columns action triggered for group ID: ' . $ulgm_current_managed_group_id );

    // Example: Conditionally display a message based on the group.
    if ( $ulgm_current_managed_group_id === 123 ) {
        echo '<p class="my-custom-message">Special instructions for Group 123!</p>';
    }
}
add_action( 'ulgm_after_add_bulk_users_columns', 'my_custom_ulgm_after_add_bulk_users_columns', 10, 1 );

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/frontend-uo_groups/add-users.php:59

<span class="uog_header header"><?php echo __( 'Password', 'uncanny-learndash-groups' ); ?></span>

												<span class="uo-table-header-note" ulg-tooltip-frontend="<?php _e( 'Set an optional password for new users. If no password is entered, a random password will be generated. If the user already exists, the user's password will not be changed and this value will be ignored.', 'uncanny-learndash-groups' ); ?>" ulg-flow-frontend="down">
													<span class="ulg-icon ulg-icon--info"></span>
												</span>
											</div>

											<?php do_action( 'ulgm_after_add_bulk_users_columns', self::$ulgm_current_managed_group_id ); ?>
										</div>
									</header>
								</div>
							</div>
							<!-- Content & No results -->
							<?php
							$remaining = ulgm()->group_management->seat->remaining_seats( self::$ulgm_current_managed_group_id );


Scroll to Top