Action uncanny-toolkit-pro

uo_group_signup_before_submit_button

Fires before the group signup submit button is displayed, allowing modifications to the form.

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

Description

Fires just before the group signup form's submit button is rendered. Developers can use this hook to inject custom content or modify elements preceding the submit button, offering fine-grained control over the form's final appearance and functionality.


Usage

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

Examples

<?php
/**
 * Example: Add a custom field before the submit button in the group registration form.
 * This hook fires just before the submit button.
 *
 * @param int $group_id The ID of the current group.
 */
function my_custom_group_signup_field( $group_id ) {
	// Check if the group ID is valid.
	if ( ! $group_id || ! is_numeric( $group_id ) ) {
		return;
	}

	// Output a custom checkbox for users to agree to terms.
	?>
	<tr>
		<td class="label">
			<label for="agree_to_terms"><?php esc_html_e( 'I agree to the terms and conditions', 'my-text-domain' ); ?></label>
		</td>
		<td class="input">
			<input type="checkbox" name="agree_to_terms" id="agree_to_terms" class="required" value="1"/>
			<input type="hidden" name="group_id_for_terms" value="<?php echo esc_attr( $group_id ); ?>"/>
		</td>
	</tr>
	<?php
}

add_action( 'uo_group_signup_before_submit_button', 'my_custom_group_signup_field', 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/group-registration-form.php:71

for="password_again"><?php esc_html_e( 'Confirm Password', 'uncanny-pro-toolkit' ); ?></label>
				</td>
				<td class="input"><input name="uncanny_group_signup_user_pass_confirm" id="password_again"
				                         class="required"
				                         placeholder="<?php esc_html_e( 'Confirm Password', 'uncanny-pro-toolkit' ); ?>"
				                         type="password"/></td>
			</tr>
			<?php do_action( 'uo_group_signup_before_submit_button', get_the_ID() ); ?>
			<tr>
				<td class="label">
					<input type="hidden" name="uncanny_group_signup_register_nonce"
					       value="<?php echo wp_create_nonce( 'uncanny_group_signup-register-nonce' ); ?>"/>
					<input type="hidden" name="gid"
					       value="<?php echo get_the_ID(); ?>"/>
					<input type="hidden" name="group_id"


Scroll to Top