Created
November 4, 2022 11:52
-
-
Save yuriinalivaiko/5322f6562464b03f2a7d6a227eb9a744 to your computer and use it in GitHub Desktop.
Hook um_render_field_type_{$type}
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_render_field_type_{$type} | |
* | |
* Type: filter | |
* | |
* Description: Change admin form field layout by $type. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/admin/core/class-admin-forms.php#L312 | |
* @link https://docs.ultimatemember.com/article/1237-umrenderfieldtypetype | |
* | |
* @package um\admin\core | |
* @see um\admin\core\Admin_Forms::render_field_by_hook() | |
* @since 2.0 | |
* @version 3.0 | |
* | |
* @param string $html Field's HTML. | |
* @param array $data Field's data. | |
* @param array $form_data Form data. | |
* @param object $admin_form Admin_Forms object. | |
*/ | |
function my_render_field_type( $html, $data, $form_data, $admin_form ) { | |
// your code here. | |
return $html; | |
} | |
$type = 'text'; | |
add_filter( "um_render_field_type_{$type}", 'my_render_field_type', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment