Skip to content

Commit

Permalink
fix: add check to only change theme if not empty (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurelfulford authored Sep 7, 2022
1 parent 0fa8c0a commit b9835f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/wizards/class-setup-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ public function api_update_theme_with_mods( $request ) {
// If the theme has to be installed, the set_theme_mod calls below will – for some reason – have no effect
// If there's a switch_theme call here, even though it's already called in Theme_Manager::install_activate_theme,
// correct mods will be saved.
switch_theme( $theme );
if ( ! empty( $theme ) ) {
switch_theme( $theme );
}

// Set homepage pattern.
if ( isset( $request['theme_mods']['homepage_pattern_index'] ) ) {
Expand Down

0 comments on commit b9835f1

Please sign in to comment.