- fixed PHP notices when there aren't UM custom roles and we get bool variable from get_option( 'um_roles' );

This commit is contained in:
nikitasinelnikov
2020-12-16 13:37:13 +02:00
parent 0ee8878f90
commit 41350e1391
10 changed files with 28 additions and 24 deletions
+2 -2
View File
@@ -400,12 +400,12 @@ function um_submit_form_register( $args ) {
//get user role from field Role dropdown or radio
if ( isset( $args['role'] ) ) {
global $wp_roles;
$um_roles = get_option( 'um_roles' );
$um_roles = get_option( 'um_roles', array() );
if ( ! empty( $um_roles ) ) {
$role_keys = array_map( function( $item ) {
return 'um_' . $item;
}, get_option( 'um_roles' ) );
}, $um_roles );
} else {
$role_keys = array();
}