From 69e31a6e52ac4abf7f427670232fa2666735f548 Mon Sep 17 00:00:00 2001 From: Denis Baranov Date: Mon, 2 Apr 2018 13:22:25 +0300 Subject: [PATCH] - small fixed. Return an empty array if the "um_roles" option is not specified --- includes/core/class-fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 62faa0df..6116b9b6 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -3137,7 +3137,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { global $wp_roles; $role_keys = array_map( function( $item ) { return 'um_' . $item; - }, get_option( 'um_roles' ) ); + }, get_option( 'um_roles', array() ) ); $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) ); $roles = UM()->roles()->get_roles( false, $exclude_roles );