Created
November 4, 2022 12:16
-
-
Save yuriinalivaiko/5b11c1a3356d927dd90d6a60526aec39 to your computer and use it in GitHub Desktop.
Hook um_submit_form_data
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_submit_form_data | |
* | |
* Type: filter | |
* | |
* Description: Change submitted data on form submit. | |
* Used in the core to prepare role fields data and trim input string values. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-form.php#L546 | |
* @link https://docs.ultimatemember.com/article/1271-umsubmitformdata | |
* | |
* @package um\core | |
* @see um\core\Form::form_init() | |
* @see um_submit_form_data_role_fields() | |
* @see um_submit_form_data_trim_fields() | |
* @since 2.0 | |
* @version 3.0 | |
* | |
* @param array $data Submitted data. | |
* @param string $mode Form mode. | |
* | |
* @return array Submitted data. | |
*/ | |
function my_submit_form_data( $data, $mode ) { | |
if ( 'login' === $mode ) { | |
// your code here. | |
} | |
return $data; | |
} | |
add_filter( 'um_submit_form_data', 'my_submit_form_data', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment