- 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
@@ -978,7 +978,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
if ( strstr( $key, 'role_' ) || $key == 'role' ) {
$field_value = strtolower( UM()->roles()->get_editable_priority_user_role( um_user( 'ID' ) ) );
$role_keys = get_option( 'um_roles' );
$role_keys = get_option( 'um_roles', array() );
if ( ! empty( $role_keys ) ) {
if ( in_array( $field_value, $role_keys ) ) {
@@ -1125,7 +1125,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
if ( strstr( $key, 'role_' ) || $key == 'role' ) {
$um_user_value = strtolower( UM()->roles()->get_editable_priority_user_role( um_user( 'ID' ) ) );
$role_keys = get_option( 'um_roles' );
$role_keys = get_option( 'um_roles', array() );
if ( ! empty( $role_keys ) ) {
if ( in_array( $um_user_value, $role_keys ) ) {