Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add theme_mods_{$stylesheet} option during populate_options() #8525

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ function populate_options( array $options = array() ) {

$options = wp_parse_args( $options, $defaults );

// 6.8.0
$options[ 'theme_mods_' . $options['stylesheet'] ] = array();

// Set autoload to no for these options.
$fat_options = array(
'moderation_keys',
Expand Down
11 changes: 11 additions & 0 deletions tests/phpunit/tests/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,17 @@ public function test_switch_theme_bogus() {
$this->assertSame( $style, get_stylesheet() );
}

/**
* Test that installation added a "theme_mods_" option for the default theme.
*
* @ticket 33600
*/
public function test_populate_options_theme_mod() {
$stylesheet = get_option( 'stylesheet' );
$this->assertSame( WP_DEFAULT_THEME, $stylesheet );
$this->assertSame( array(), get_option( "theme_mods_{$stylesheet}" ) );
}

/**
* Test _wp_keep_alive_customize_changeset_dependent_auto_drafts.
*
Expand Down
Loading