- fixed save form type backend;

- fixed registration form role setting;
This commit is contained in:
nikitozzzzzzz
2017-08-20 20:49:20 +03:00
parent a1bb992c3b
commit f48bb565ad
4 changed files with 15 additions and 12 deletions
+8 -5
View File
@@ -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;
}
/**
+2 -2
View File
@@ -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 );