Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Created November 6, 2022 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriinalivaiko/d96d8b1c3ebdecc48f7d2200a8353525 to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/d96d8b1c3ebdecc48f7d2200a8353525 to your computer and use it in GitHub Desktop.
Hook um_before_{$mode}_fields
<?php
/**
* Hook: um_before_{$mode}_fields
*
* Type: action
*
* Description: Fires before the form fields.
* May be used to display custom content before form fields or add hidden fields.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/templates/login.php#L50
* @link https://docs.ultimatemember.com/article/1071-umbeforemodefields
*
* @package um\templates
* @see templates/login.php
* @see templates/register.php
* @see um_profile_content_main()
* @since 2.0
* @version 3.0
*
* @param array $args Form shortcode arguments.
*/
function my_before_login_fields( $args ) {
// your code here.
}
$mode = 'login';
add_action( "um_before_{$mode}_fields", 'my_before_login_fields', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment