From 900aa7bf893e4479aeee7ad13390aed8a91a34e4 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 20 Feb 2024 09:43:07 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@57661 git-svn-id: http://core.svn.wordpress.org/trunk@57162 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-settings.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 37448933df..82cb1c2db6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-beta1-57660'; +$wp_version = '6.5-beta1-57661'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index fe2aef2479..a341cbccdb 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -390,8 +390,8 @@ require ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api-directi require ABSPATH . WPINC . '/interactivity-api/interactivity-api.php'; require ABSPATH . WPINC . '/class-wp-plugin-dependencies.php'; -wp_script_modules()->add_hooks(); -wp_interactivity()->add_hooks(); +add_action( 'after_setup_theme', array( wp_script_modules(), 'add_hooks' ) ); +add_action( 'after_setup_theme', array( wp_interactivity(), 'add_hooks' ) ); $GLOBALS['wp_embed'] = new WP_Embed();