Skip to content

Commit

Permalink
Fix "Parameter #3 $autoload of function update_option expects bool|nu…
Browse files Browse the repository at this point in the history
…ll, string given." error
  • Loading branch information
carstingaxion committed Nov 13, 2024
1 parent db373f0 commit 62e2fdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inc/preferred-languages/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ function set_pref_lang_from_impressum( array $new_value, array|bool $old_value )
// Switch formal and informal translations, based on choosen feature.
$_defaults = ( $use_formal ) ? $_formal_defaults : $_informal_defaults;

update_option( 'preferred_languages', join( ',', $_defaults ), 'yes' );
update_option( 'preferred_languages', join( ',', $_defaults ), true );

update_option( 'WPLANG', $_defaults[0], 'yes' );
update_option( 'WPLANG', $_defaults[0], true );

return $new_value;
}
6 changes: 3 additions & 3 deletions inc/sites/installation.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function set_home_page( WP_Site $new_site, array $args ) {
$home_page_id = wp_insert_post( $new_home_page, true );

if ( ! is_wp_error( $home_page_id ) ) {
update_option( 'page_on_front', (int) $home_page_id, 'yes' );
update_option( 'page_on_front', (int) $home_page_id, true );
}
}

Expand Down Expand Up @@ -281,7 +281,7 @@ function set_imprint_page( WP_Site $new_site, array $args ): void {
// Maybe possible, when 'impressum_imprint_options' is pre-populated during install,
// but was never really used within this blog.
unset( $impressum_imprint_options['country'] );
update_option( 'impressum_imprint_options', $impressum_imprint_options, 'no' );
update_option( 'impressum_imprint_options', $impressum_imprint_options, false );
}


Expand Down Expand Up @@ -319,6 +319,6 @@ function set_privacy_page(): void {

// Save our option if everything was fine.
if ( ! empty( $policy_page_id ) ) {
update_option( 'wp_page_for_privacy_policy', (int) $policy_page_id[0], 'no' );
update_option( 'wp_page_for_privacy_policy', (int) $policy_page_id[0], false );
}
}

0 comments on commit 62e2fdb

Please sign in to comment.