Make WordPress Core


Ignore:
Timestamp:
12/14/2021 03:31:14 PM (3 years ago)
Author:
hellofromTonya
Message:

Customize: Overlay incompatible banner for block themes.

Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.

Non-block themes are not affected by this change and continue to work in Customizer.

Follow-up to [41648], [41893], [52279].

Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r52352 r52371  
    58095809
    58105810            // Load all installed themes from wp_prepare_themes_for_js().
    5811             $themes = array( 'themes' => wp_prepare_themes_for_js() );
    5812             foreach ( $themes['themes'] as &$theme ) {
    5813                 $theme['type']   = 'installed';
    5814                 $theme['active'] = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] );
     5811            $themes = array( 'themes' => array() );
     5812            foreach ( wp_prepare_themes_for_js() as $theme ) {
     5813                $theme['type']      = 'installed';
     5814                $theme['active']    = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] );
     5815                $themes['themes'][] = $theme;
    58155816            }
    58165817        } elseif ( 'wporg' === $theme_action ) {
Note: See TracChangeset for help on using the changeset viewer.