Make WordPress Core

Opened 15 years ago

Closed 15 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 Owned by: koopersmith
Priority: normal Milestone: 3.4
Component: Customize Version: 3.4
Severity: normal Keywords:
Cc: Focuses:

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
15 years ago

  • Component General → Themes
  • Milestone Awaiting Review → 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
15 years ago

  • Component Themes → Customizer

#3 @koopersmith
15 years ago

  • Owner set to koopersmith
  • Resolution → fixed
  • Status new → 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.