Skip to content

Commit

Permalink
Merge pull request #741 from 10up/fix/null-settings
Browse files Browse the repository at this point in the history
Change how we check for settings to support `null` values
  • Loading branch information
dkotter committed Mar 7, 2024
2 parents 378e225 + 910dab3 commit 7ea7701
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Classifai/Features/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function add_provider_fields() {
*/
protected function merge_settings( array $settings = [], array $defaults = [] ): array {
foreach ( $defaults as $key => $value ) {
if ( ! isset( $settings[ $key ] ) ) {
if ( ! array_key_exists( $key, $settings ) ) {
$settings[ $key ] = $defaults[ $key ];
} elseif ( is_array( $value ) ) {
if ( is_array( $settings[ $key ] ) ) {
Expand Down

0 comments on commit 7ea7701

Please sign in to comment.