Action uncanny-learndash-groups

ulgm_before_add_bulk_users_columns

Fires before the bulk users columns are added, allowing for modifications.

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

Description

Fires before the main user columns are displayed in the bulk user adding interface. Developers can use this action to inject custom columns, modify existing ones, or add specific UI elements before the standard user data is presented, allowing for enhanced bulk user management functionality.


Usage

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

Parameters

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

Examples

<?php
/**
 * Add a custom column header to the "Add Bulk Users" table before the first name column.
 * This example adds a "Username" column header.
 */
add_action( 'ulgm_before_add_bulk_users_columns', function( $ulgm_current_managed_group_id ) {
	// Only add the column if we are currently managing a group.
	if ( $ulgm_current_managed_group_id ) {
		?>
		<div class="header-column header-leaders-username uo-table-cell uo-table-cell-1_5">
			<span class="uog_header header"><?php echo __( 'Username', 'your-text-domain' ); ?></span>
		</div>
		<?php
	}
}, 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:35

<div class="uo-row uo-table-row uo-table-header">
									<header class="pseudo-table-header">
										<div class="uo-row ulgm-table-row-flex">
											<div class="header-column header-leaders-select-all uo-table-cell uo-table-cell-0_5">

											</div>

											<?php do_action( 'ulgm_before_add_bulk_users_columns', self::$ulgm_current_managed_group_id ); ?>

											<div class="header-column header-leaders-first-name uo-table-cell uo-table-cell-2">
												<span class="uog_header header"><?php echo __( 'First name', 'uncanny-learndash-groups' ); ?></span>
											</div>


											<div class="header-column header-leaders-last-name uo-table-cell uo-table-cell-2">


Scroll to Top