- add meta to user

This commit is contained in:
ashubawork
2024-01-16 14:00:22 +02:00
parent 2107336cf9
commit d9021373ce
6 changed files with 30 additions and 41 deletions
+3 -9
View File
@@ -1690,7 +1690,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
?>
*
*/
function approve( $repeat = true, $args = array() ) {
public function approve( $repeat = true ) {
$user_id = um_user( 'ID' );
if ( ! $repeat ) {
@@ -1702,7 +1702,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
delete_option( "um_cache_userdata_{$user_id}" );
if ( um_user( 'account_status' ) == 'awaiting_admin_review' ) {
if ( 'awaiting_admin_review' === um_user( 'account_status' ) ) {
$userdata = get_userdata( $user_id );
$this->maybe_generate_password_reset_key( $userdata );
@@ -1712,13 +1712,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
} else {
//$userdata = get_userdata( $user_id );
//get_password_reset_key( $userdata );
$welcome_email_args = array();
if ( true === (bool) $args['generated_pass'] ) {
$welcome_email_args = array(
'generated_pass' => 1,
);
}
UM()->mail()->send( um_user( 'user_email' ), 'welcome_email', $welcome_email_args );
UM()->mail()->send( um_user( 'user_email' ), 'welcome_email' );
}
$this->set_status( 'approved' );