diff --git a/vip-helpers/vip-roles.php b/vip-helpers/vip-roles.php index 0b42a3dd65..911245dad9 100644 --- a/vip-helpers/vip-roles.php +++ b/vip-helpers/vip-roles.php @@ -30,6 +30,10 @@ function wpcom_vip_get_role_caps( $role ) { * @param array $capabilities Key/value array of capabilities for the role */ function wpcom_vip_add_role( $role, $name, $capabilities ) { + if ( ! is_array( $capabilities ) ) { + $capabilities = array(); + } + if ( array_is_list( $capabilities ) && ! array_filter( $capabilities, 'is_bool' ) ) { $capabilities = array_flip( $capabilities ); $capabilities = array_map( '__return_true', $capabilities );