Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Last active November 4, 2022 20:26
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/b5506b3ecf38c078cf8330532bfb8207 to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/b5506b3ecf38c078cf8330532bfb8207 to your computer and use it in GitHub Desktop.
Hook um_pre_{$mode}_shortcode
<?php
/**
* Hook: um_pre_{$mode}_shortcode
*
* Type: action
*
* Description: Fires before the form shortcode is loaded.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-password.php#L199
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-shortcodes.php#L752
* @link https://docs.ultimatemember.com/article/1198-umpremodeshortcode
*
* @package um\core
* @see um\core\Password::ultimatemember_password()
* @see um\core\Shortcodes::load()
* @since 2.0
* @version 3.0* Removed from the Password form.
*
* @param array $args Form shortcode arguments.
*/
function my_pre_login_shortcode() {
// your code here.
}
$mode = 'login';
add_action( "um_pre_{$mode}_shortcode", 'my_pre_login_shortcode', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment