Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#20508 closed defect (bug) (fixed)

3.4 Preview/Customize - "Save and Activate" doesn't save advanced theme settings (eg: 2011)

Reported by: tomauger's profile TomAuger Owned by: koopersmith's profile koopersmith
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords:
Focuses: Cc:

Description

As an end user, if I am customizing an inactive theme and then press the "Save and Activate" button, I'm expecting that the theme I was customizing will be activated WITH the settings that I just customized.

For example:

  1. suppose I have the Carrington theme activated currently.
  2. I click the "Customize" link on the Twenty Eleven theme.
  3. Then I go and change the background colour.
  4. Now I click "Save and Activate".
  5. The Twenty Eleven theme is activated, but the background colour is not applied. The same is true if I change the background image, the header text colour etc.
  6. However, if I change the blog title or caption, that DOES get saved.

Browser tested with: Chrome

Change History (3)

#1 @SergeyBiryukov
13 years ago

  • Component changed from General to Themes
  • Milestone changed from Awaiting Review to 3.4

From my testing, this happens when saving theme-specific features (like custom-background) not supported by current theme (e.g. Carrington 2.2).

Seems that the settings are saved on admin_init, which is after current theme mods (or a lack thereof) have been initialized on after_setup_theme.

WP_Customize_Setting::check_capabilities() then returns false, and the new theme mods are not applied in WP_Customize_Setting::save().

#2 @ryan
13 years ago

  • Component changed from Themes to Customizer

#3 @koopersmith
13 years ago

  • Owner set to koopersmith
  • Resolution set to fixed
  • Status changed from new to closed

In [20584]:

Theme Customizer: Preview the target theme during save to ensure all settings are properly registered. Temporarily revert to the active theme when running switch_theme. fixes #20508, see #19910.

Introduces WP_Customize->start_previewing_theme() and WP_Customize->stop_previewing_theme() to easily enable/disable the theme filters as needed.

Note: See TracTickets for help on using tickets.