Created
November 4, 2022 12:08
-
-
Save yuriinalivaiko/6f6dc9192a9bd0fbc68b52c0c3d82327 to your computer and use it in GitHub Desktop.
Hook um_{$key}_form_edit_field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hook: um_{$key}_form_edit_field | |
* | |
* Type: filter | |
* | |
* Description: Change field HTML by field $key. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-fields.php#L3882 | |
* @link https://docs.ultimatemember.com/article/1321-umkeyformeditfield | |
* | |
* @package um\core | |
* @see um\core\Fields::edit_field() | |
* @since 2.0 | |
* @version 3.0 | |
* | |
* @param string $output Field HTML. | |
* @param string $mode Form mode. | |
* | |
* @return string Field HTML. | |
*/ | |
function my_form_edit_field( $output, $mode ) { | |
if ( 'login' === $mode ) { | |
// your code here. | |
} | |
return $output; | |
} | |
$key = 'user_email'; | |
add_filter( "um_{$key}_form_edit_field", 'my_form_edit_field', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment