From 97a07158d3903741d2ae639205299064cdaff918 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Thu, 18 May 2023 12:56:57 +0300 Subject: [PATCH 1/3] - add emails to install info --- includes/admin/core/class-admin-settings.php | 28 +++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index a3a090f1..946d97cd 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -3431,18 +3431,22 @@ Blacklist Words: options()->get('bl --- UM Email Configurations --- -Mail appears from: options()->get('mail_from'); if( ! empty( $mail_from ) ){echo UM()->options()->get('mail_from');}else{echo "-";}; echo "\n";?> -Mail appears from address: options()->get('mail_from_addr'); if( ! empty( $mail_from_addr ) ){echo UM()->options()->get('mail_from_addr');}else{echo "-";}; echo "\n";?> -Use HTML for E-mails: info_value( UM()->options()->get('email_html'), 'yesno', true ); ?> -Account Welcome Email: info_value( UM()->options()->get('welcome_email_on'), 'yesno', true ); ?> -Account Activation Email: info_value( UM()->options()->get('checkmail_email_on'), 'yesno', true ); ?> -Pending Review Email: info_value( UM()->options()->get('pending_email_on'), 'yesno', true ); ?> -Account Approved Email: info_value( UM()->options()->get('approved_email_on'), 'yesno', true ); ?> -Account Rejected Email: info_value( UM()->options()->get('rejected_email_on'), 'yesno', true ); ?> -Account Deactivated Email: info_value( UM()->options()->get('inactive_email_on'), 'yesno', true ); ?> -Account Deleted Email: info_value( UM()->options()->get('deletion_email_on'), 'yesno', true ); ?> -Password Reset Email: info_value( UM()->options()->get('resetpw_email_on'), 'yesno', true ); ?> -Password Changed Email: info_value( UM()->options()->get('changedpw_email_on'), 'yesno', true ); ?> +Mail appears from: options()->get( 'mail_from' ); if ( ! empty( $mail_from ) ){ echo UM()->options()->get( 'mail_from' ); } else { echo "-"; }; echo "\n"; ?> +Mail appears from address: options()->get( 'mail_from_addr' ); if ( ! empty( $mail_from_addr ) ) { echo UM()->options()->get( 'mail_from_addr' ); } else { echo "-"; }; echo "\n"; ?> +Use HTML for E-mails: info_value( UM()->options()->get( 'email_html' ), 'yesno', true ); ?> +Account Welcome Email: info_value( UM()->options()->get( 'welcome_email_on' ), 'yesno', true ); ?> +Account Activation Email: info_value( UM()->options()->get( 'checkmail_email_on' ), 'yesno', true ); ?> +Pending Review Email: info_value( UM()->options()->get( 'pending_email_on' ), 'yesno', true ); ?> +Account Approved Email: info_value( UM()->options()->get( 'approved_email_on' ), 'yesno', true ); ?> +Account Rejected Email: info_value( UM()->options()->get( 'rejected_email_on' ), 'yesno', true ); ?> +Account Deactivated Email: info_value( UM()->options()->get( 'inactive_email_on' ), 'yesno', true ); ?> +Account Deleted Email: info_value( UM()->options()->get( 'deletion_email_on' ), 'yesno', true ); ?> +Password Reset Email: info_value( UM()->options()->get( 'resetpw_email_on' ), 'yesno', true ); ?> +Password Changed Email: info_value( UM()->options()->get( 'changedpw_email_on' ), 'yesno', true ); ?> +Account Updated Email: info_value( UM()->options()->get( 'changedaccount_email_on' ), 'yesno', true ); ?> +New User Notification: info_value( UM()->options()->get( 'notification_new_user_on' ), 'yesno', true ); ?> +Account Needs Review Notification: info_value( UM()->options()->get( 'notification_review_on' ), 'yesno', true ); ?> +Account Deletion Notification: info_value( UM()->options()->get( 'notification_deletion_on' ), 'yesno', true ); ?> --- UM Total Users --- From 5206ee5a24c0a308aef1f2840f7c3f5175df8a40 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Tue, 23 May 2023 12:01:56 +0300 Subject: [PATCH 2/3] - fix wrong $_um_profile_id for not logged in users --- includes/core/class-fields.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 58e70013..6eb635b6 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2123,9 +2123,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( empty( $_um_profile_id ) ) { $_um_profile_id = um_user( 'ID' ); } - if ( ! is_user_logged_in() ) { - $_um_profile_id = 0; - } // get whole field data if ( isset( $data ) && is_array( $data ) ) { From 52172a89fb1df9b5b4645ef6ec9986a73b81ca23 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Tue, 23 May 2023 12:29:36 +0300 Subject: [PATCH 3/3] - fix is_block checking (for register form in widgets or blocks) --- includes/core/class-fields.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 6eb635b6..fc9ceb04 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2124,6 +2124,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $_um_profile_id = um_user( 'ID' ); } + if ( ! is_user_logged_in() && isset( $data['is_block'] ) && 1 === (int) $data['is_block'] ) { + $_um_profile_id = 0; + } + // get whole field data if ( isset( $data ) && is_array( $data ) ) { $data = $this->get_field( $key ); @@ -4231,6 +4235,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $col1_fields = $this->get_fields_in_column( $subrow_fields, 1 ); if ( $col1_fields ) { foreach ( $col1_fields as $key => $data ) { + if ( ! empty( $args['is_block'] ) ) { + $data['is_block'] = 1; + } $output .= $this->edit_field( $key, $data ); } } @@ -4242,6 +4249,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $col1_fields = $this->get_fields_in_column( $subrow_fields, 1 ); if ( $col1_fields ) { foreach ( $col1_fields as $key => $data ) { + if ( ! empty( $args['is_block'] ) ) { + $data['is_block'] = 1; + } $output .= $this->edit_field( $key, $data ); } } @@ -4251,6 +4261,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $col2_fields = $this->get_fields_in_column( $subrow_fields, 2 ); if ( $col2_fields ) { foreach ( $col2_fields as $key => $data ) { + if ( ! empty( $args['is_block'] ) ) { + $data['is_block'] = 1; + } $output .= $this->edit_field( $key, $data ); } }