Make WordPress Core


Ignore:
Timestamp:
02/20/2024 09:41:48 AM (4 months ago)
Author:
swissspidy
Message:

Script Loader: Add hooks for script modules and interactivity API only on after_setup_theme.

Ensures that wp_is_block_theme() is not called too early before the themes are fully setup.
This addresses an issue where a parent theme was mistakenly marked as being missing.

Props scruffian, youknowriad, swissspidy, poena, dennysdionigi, bgardner, westonruter.
Fixes #60411.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r57658 r57661  
    391391require ABSPATH . WPINC . '/class-wp-plugin-dependencies.php';
    392392
    393 wp_script_modules()->add_hooks();
    394 wp_interactivity()->add_hooks();
     393add_action( 'after_setup_theme', array( wp_script_modules(), 'add_hooks' ) );
     394add_action( 'after_setup_theme', array( wp_interactivity(), 'add_hooks' ) );
    395395
    396396$GLOBALS['wp_embed'] = new WP_Embed();
Note: See TracChangeset for help on using the changeset viewer.