Apply disable UI filter to experimental features too

This change disable UI for both experimental and mature features

Previously we applied this filter to mature ones only
This commit is contained in:
Saad Tarhi 2023-03-02 10:39:33 +01:00
parent 615365d14e
commit e6bee7b785
1 changed files with 5 additions and 7 deletions

View File

@ -555,13 +555,7 @@ class FeaturesController {
return $features[ $feature_id ]['is_experimental'];
}
);
$disabled_ui_feature_ids = array_filter(
$feature_ids,
function( $feature_id ) use ( $features ) {
return $features[ $feature_id ]['disable_ui'];
}
);
$mature_feature_ids = array_diff( $feature_ids, $experimental_feature_ids, $disabled_ui_feature_ids );
$mature_feature_ids = array_diff( $feature_ids, $experimental_feature_ids );
$feature_ids = array_merge( $mature_feature_ids, array( 'mature_features_end' ), $experimental_feature_ids );
foreach ( $feature_ids as $id ) {
@ -593,6 +587,10 @@ class FeaturesController {
continue;
}
if ( isset( $features[ $id ]['disable_ui'] ) && $features[ $id ]['disable_ui'] ) {
continue;
}
$feature_settings[] = $this->get_setting_for_feature( $id, $features[ $id ], $admin_features_disabled );
}