Skip to content

Commit

Permalink
Merge pull request #805 from 10up/fix/classification-enabled-taxonomies
Browse files Browse the repository at this point in the history
[Classification] Ensure that the classification feature suggests or sets terms for enabled taxonomies only.
  • Loading branch information
dkotter authored Sep 26, 2024
2 parents 57dac03 + 30a35dc commit ac2c778
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions includes/Classifai/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,7 @@ function sanitize_number_of_responses_field( string $key, array $new_settings, a
function get_classification_feature_enabled( string $classify_by ): bool {
$settings = ( new Classification() )->get_settings();

return filter_var(
isset( $settings[ $classify_by ] ) ?? false,
FILTER_VALIDATE_BOOLEAN
);
return ( ! empty( $settings[ $classify_by ] ) );
}

/**
Expand Down

0 comments on commit ac2c778

Please sign in to comment.