uo_group_signup_after_table
Fires after the group signup table is displayed, providing an ID for further actions.
add_action( 'uo_group_signup_after_table', $callback, 10, 1 );
Description
Fires after the group registration form's table element. Developers can use this action to append custom content or perform actions immediately following the form's main structure. It passes the current post ID as a parameter, useful for context-aware modifications.
Usage
add_action( 'uo_group_signup_after_table', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Example function to add a custom field after the group registration table.
*
* This function demonstrates how to hook into 'uo_group_signup_after_table'
* to add additional information or fields to the group registration form
* after the main table has been rendered.
*
* @param int $post_id The ID of the current post or group.
*/
function my_custom_group_signup_field( $post_id ) {
// Ensure we have a valid post ID.
if ( ! $post_id || ! is_numeric( $post_id ) ) {
return;
}
// You could potentially fetch additional data related to the post_id here.
// For demonstration, we'll just add a simple notice.
$notice_message = sprintf(
__( 'Thank you for registering for group %s. You will receive a confirmation email shortly.', 'my-text-domain' ),
get_the_title( $post_id )
);
echo '<div class="my-custom-group-notice">';
echo '<p>' . esc_html( $notice_message ) . '</p>';
// You could add more complex HTML here, like another input field,
// a link to a related resource, or conditional logic based on $post_id.
echo '</div>';
}
// Add the action hook with the correct number of arguments.
// The third parameter '1' indicates that our callback function accepts 1 argument.
add_action( 'uo_group_signup_after_table', '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:87
<input type="hidden" name="key"
value="<?php echo crypt( get_the_ID(), 'uncanny-group' ); ?>"/></td>
<td class="input"><input type="submit" class="uncannyowl-btn uncannyowl-btn--primary"
value="<?php esc_html_e( 'Register Your Account', 'uncanny-pro-toolkit' ); ?>"/>
</td>
</tr>
</table>
<?php do_action( 'uo_group_signup_after_table', get_the_ID() ); ?>
</fieldset>
</form>