mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 21:23:39 +09:00
* added force attribute to change user status actions for ignore current user condition in some cases;
This commit is contained in:
@@ -117,25 +117,25 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
|
||||
|
||||
$account_secret_hash = get_user_meta( $user_id, 'account_secret_hash', true );
|
||||
if ( empty( $account_secret_hash ) || strtolower( sanitize_text_field( $_REQUEST['hash'] ) ) !== strtolower( $account_secret_hash ) ) {
|
||||
wp_die( __( 'This activation link is expired or have already been used.', 'ultimate-member' ) );
|
||||
wp_die( esc_html__( 'This activation link is expired or have already been used.', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
$account_secret_hash_expiry = get_user_meta( $user_id, 'account_secret_hash_expiry', true );
|
||||
if ( ! empty( $account_secret_hash_expiry ) && time() > $account_secret_hash_expiry ) {
|
||||
wp_die( __( 'This activation link is expired.', 'ultimate-member' ) );
|
||||
wp_die( esc_html__( 'This activation link is expired.', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
$redirect = um_get_core_page( 'login', 'account_active' );
|
||||
$set_password_required = get_user_meta( $user_id, 'um_set_password_required', true );
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
UM()->common()->users()->approve( $user_id );
|
||||
UM()->common()->users()->approve( $user_id, true );
|
||||
if ( ! empty( $set_password_required ) ) {
|
||||
$redirect = um_user( 'password_reset_link' );
|
||||
}
|
||||
um_reset_user();
|
||||
|
||||
$user_role = UM()->roles()->get_priority_user_role( $user_id );
|
||||
$user_role = UM()->roles()->get_priority_user_role( $user_id );
|
||||
$user_role_data = UM()->roles()->role_data( $user_role );
|
||||
|
||||
// log in automatically
|
||||
|
||||
@@ -1570,7 +1570,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
*/
|
||||
public function approve( $repeat = true ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- deprecated function
|
||||
_deprecated_function( __METHOD__, '2.8.7', 'UM()->common()->users()->approve()' );
|
||||
UM()->common()->users()->approve( um_user( 'ID' ) );
|
||||
UM()->common()->users()->approve( um_user( 'ID' ), $repeat );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
function um_post_registration_approved_hook( $user_id ) {
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
UM()->common()->users()->approve( $user_id );
|
||||
UM()->common()->users()->approve( $user_id, true );
|
||||
}
|
||||
add_action( 'um_post_registration_approved_hook', 'um_post_registration_approved_hook' );
|
||||
|
||||
@@ -23,7 +23,7 @@ add_action( 'um_post_registration_approved_hook', 'um_post_registration_approved
|
||||
function um_post_registration_checkmail_hook( $user_id ) {
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
UM()->common()->users()->send_activation( $user_id );
|
||||
UM()->common()->users()->send_activation( $user_id, true );
|
||||
}
|
||||
add_action( 'um_post_registration_checkmail_hook', 'um_post_registration_checkmail_hook' );
|
||||
|
||||
@@ -35,7 +35,7 @@ add_action( 'um_post_registration_checkmail_hook', 'um_post_registration_checkma
|
||||
function um_post_registration_pending_hook( $user_id ) {
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
UM()->common()->users()->set_as_pending( $user_id );
|
||||
UM()->common()->users()->set_as_pending( $user_id, true );
|
||||
}
|
||||
add_action( 'um_post_registration_pending_hook', 'um_post_registration_pending_hook' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user