Function
Filter the user data before it is inserted by wp_insert_user().
tml_ms_filter_pre_insert_user_data( array $data = array(), bool $update = false )
Parameters
-
$dataarray Defaultarray() - The user data to insert.
-
$updatebool Defaultfalse - Whether an existing user is being updated.
Return
array
The user data to insert.
Source
function tml_ms_filter_pre_insert_user_data( $data = array(), $update = false ) {
if ( $update ) {
return $data;
}
$password = tml_ms_get_activation_password();
if ( '' !== $password ) {
$data['user_pass'] = wp_hash_password( $password );
}
return $data;
}
Uses
Changelog
| Version | Description |
|---|---|
| 7.0 | Introduced. |
| 7.2.2 | Added the <code>$update</code> parameter. |