WordPress.org

Make WordPress Core

Changeset 51197


Ignore:
Timestamp:
06/22/2021 05:55:52 AM (3 months ago)
Author:
peterwilsoncc
Message:

Themes: Improve Gutenberg check before activating an FSE theme.

Account for sites enabling Gutenberg as an mu-plugin when determining whether full-site-editing themes can be enabled. This replaces the check the plugin is active with a check whether the function gutenberg_is_fse_theme() is defined.

Follow up to [51193].

Props noisysocks, peterwilsoncc, SergeyBiryukov.
See #53410.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r51193 r51197  
    190190            $theme_tags = $wp_customize->theme()->get( 'Tags' );
    191191
    192             if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
     192            if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
    193193                $fse_safe = false;
    194194            }
  • trunk/src/wp-includes/theme.php

    r51193 r51197  
    912912    $theme_tags = $theme->get( 'Tags' );
    913913
    914     if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
     914    if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
    915915        return new WP_Error(
    916916            'theme_requires_fse',
Note: See TracChangeset for help on using the changeset viewer.