Created
November 4, 2022 13:20
-
-
Save yuriinalivaiko/babc0fdf4ff1ed7bbdbbfdb677468af0 to your computer and use it in GitHub Desktop.
Hook um_{$type}_form_show_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_{$type}_form_show_field | |
* | |
* Type: filter | |
* | |
* Description: Change field HTML by field $type. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-fields.php#L4490 | |
* @link https://docs.ultimatemember.com/article/1323-umtypeformshowfield | |
* | |
* @package um\core | |
* @see um\core\Fields::view_field() | |
* @since 2.0 | |
* @version 3.0 | |
* | |
* @param string $output Field HTML. | |
* @param string $mode Form mode. | |
* | |
* @return string Field HTML. | |
*/ | |
function my_type_form_show_field( $output, $mode ) { | |
if ( 'login' === $mode ) { | |
// your code here. | |
} | |
return $output; | |
} | |
$type = 'text'; | |
add_filter( "um_{$type}_form_show_field", 'my_type_form_show_field', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment