diff --git a/includes/admin/core/packages/2.0-beta1/menus.php b/includes/admin/core/packages/2.0-beta1/menus.php index a1ecb262..80f0ce2a 100644 --- a/includes/admin/core/packages/2.0-beta1/menus.php +++ b/includes/admin/core/packages/2.0-beta1/menus.php @@ -18,9 +18,15 @@ $menus = get_posts( array( foreach ( $menus as $menu ) { $menu_roles = get_post_meta( $menu->ID, 'menu-item-um_nav_roles', true ); - foreach ( $menu_roles as $i => $role_k ) { - $menu_roles[ $i ] = $roles_associations[ $role_k ]; + if( !is_array( $menu_roles ) ) { + $menu_roles = array(); } + foreach ( $menu_roles as $i => $role_k ) { + if( $role_k != '' && isset( $roles_associations[ $role_k ] ) ) { + $menu_roles[ $i ] = $roles_associations[ $role_k ]; + } + } + update_post_meta( $menu->ID, 'menu-item-um_nav_roles', $menu_roles ); } \ No newline at end of file