mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed save form type backend;
- fixed registration form role setting;
This commit is contained in:
@@ -285,12 +285,16 @@ if ( ! class_exists( 'Form' ) ) {
|
||||
*/
|
||||
function assigned_role( $post_id ) {
|
||||
|
||||
$global_role = get_option( 'default_role' ); // WP Global settings
|
||||
|
||||
$um_global_role = um_get_option( 'register_role' ); // UM Settings Global settings
|
||||
if ( ! empty( $um_global_role ) )
|
||||
$global_role = $um_global_role; // Form Global settings
|
||||
|
||||
|
||||
$mode = $this->form_type( $post_id );
|
||||
$use_custom = get_post_meta( $post_id, "_um_{$mode}_use_custom_settings", true );
|
||||
|
||||
$global_role = get_option('default_role'); // Form Global settings
|
||||
|
||||
if ( $use_custom ) { // Non-Global settings
|
||||
if ( $use_custom ) { // Custom Form settings
|
||||
$role = get_post_meta( $post_id, "_um_{$mode}_role", true );
|
||||
}
|
||||
|
||||
@@ -299,7 +303,6 @@ if ( ! class_exists( 'Form' ) ) {
|
||||
}
|
||||
|
||||
return $role;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
|
||||
do_action( 'um_before_new_user_register', $args );
|
||||
|
||||
$default_role = get_option( 'default_role', true );
|
||||
$user_role = UM()->form()->assigned_role( UM()->form()->form_id );
|
||||
/* if ( empty( $default_role ) )
|
||||
$default_role = get_option( 'default_role' );*/
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
'user_login' => $user_login,
|
||||
'user_pass' => $user_password,
|
||||
'user_email' => $user_email,
|
||||
'role' => $default_role,
|
||||
'role' => $user_role,
|
||||
);
|
||||
$user_id = wp_insert_user( $userdata );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user