Skip to content

Instantly share code, notes, and snippets.

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/26acc016c935ce3ea901329fa1005d0b to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/26acc016c935ce3ea901329fa1005d0b to your computer and use it in GitHub Desktop.
Hook um_reset_password_shortcode_args_filter
<?php
/**
* Hook: um_reset_password_shortcode_args_filter
*
* Type: filter
*
* Description: Extend the password reset form arguments.
* May be used to select custom template file or change the password reset form alignment and width.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-password.php#L157
* @link https://docs.ultimatemember.com/article/1242-umresetpasswordshortcodeargsfilter
*
* @package um\core
* @see um\core\Password::ultimatemember_password()
* @since 2.0
* @deprecated since version 3.0
*
* @param array $args Password reset form shortcode arguments.
* - template (string) - Template name. Default 'password-reset'.
* - mode (string) - Mode. Default 'password'.
* - form_id (string) - Form ID. Default 'um_password_id'
* - max_width (string) - Form width. Default '450px'.
* - align (string) - Form alignment. Default 'center'.
*
* @return array Password reset form shortcode arguments.
*/
function my_reset_password_shortcode_args( $args ) {
// How to change the form alignment.
$args['align'] = 'left';
// How to change the form width.
$args['max_width'] = '600px';
return $args;
}
add_filter( 'um_reset_password_shortcode_args_filter', 'my_reset_password_shortcode_args', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment