- fixed PHP notices/warnings;

This commit is contained in:
nikitasinelnikov
2020-12-16 14:46:38 +02:00
parent 41350e1391
commit ba291a6bfe
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) {
function um_on_roles_update( $option, $old_value, $value ) {
global $wp_roles;
if ( isset( $wp_roles->role_key ) && $option == $wp_roles->role_key ) {
if ( is_object( $wp_roles ) && isset( $wp_roles->role_key ) && $option == $wp_roles->role_key ) {
foreach ( $value as $role_key => $role_data ) {
$role_keys = get_option( 'um_roles', array() );
$role_keys = array_map( function( $item ) {