Make WordPress Core


Ignore:
Timestamp:
03/11/2025 12:31:07 PM (12 months ago)
Author:
joemcgill
Message:

Themes: Fix resolution of parent themes.

This fixes an issue introduced in [59885] whereby calling WP_Theme:is_block_theme() before themes are set up resulted in the parent theme to not be resolved. To address this, post support for editor default-mode has been moved to a standalone callback, wp_set_editor_default_mode(), which is called on the after_setup_theme hook. In addition, if WP_Theme::is_block_theme is called too early, a _doing_it_wrong() error will now be thrown.

Props fabiankaegy, joemcgill, peterwilsoncc, jorbin, krupajnanda, riddhidave, ugyensupport, navi161, manojmaharrshi, Ankit K Gupta, narenin, shailu25, pooja1210.
Fixes #63062.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r59838 r59968  
    738738add_action( 'wp_footer', 'the_block_template_skip_link' ); // Retained for backwards-compatibility. Unhooked by wp_enqueue_block_template_skip_link().
    739739add_action( 'after_setup_theme', 'wp_enable_block_templates', 1 );
     740add_action( 'after_setup_theme', 'wp_set_editor_default_mode', 2 ); // Run after enabling block templates.
    740741add_action( 'wp_loaded', '_add_template_loader_filters' );
    741742
Note: See TracChangeset for help on using the changeset viewer.