Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions features/requests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Feature: Requests integration with both v1 and v2

Given a WP installation
And I run `vendor/bin/wp core update --version=5.8 --force`
And I run `rm -r wp-content/themes/*`

When I run `vendor/bin/wp core version`
Then STDOUT should contain:
Expand All @@ -46,6 +47,7 @@ Feature: Requests integration with both v1 and v2
Scenario: Current version with WordPress-bundled Requests v1
Given a WP installation
And I run `wp core update --version=5.8 --force`
And I run `rm -r wp-content/themes/*`

When I run `wp core version`
Then STDOUT should contain:
Expand Down
11 changes: 11 additions & 0 deletions php/WP_CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,12 @@ public function action_setup_theme_wp_cli_skip_themes() {
add_filter( $hook, $wp_cli_filter_active_theme, 999 );
}

// Noop memoization added in WP 6.4.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WordPress core global.
$GLOBALS['wp_stylesheet_path'] = null;
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WordPress core global.
$GLOBALS['wp_template_path'] = null;

// Remove theme-related actions not directly tied into the theme lifecycle.
if ( WP_CLI::get_runner()->config['skip-themes'] ) {
$theme_related_actions = [
Expand All @@ -1812,6 +1818,11 @@ static function () use ( $hooks, $wp_cli_filter_active_theme ) {
foreach ( $hooks as $hook ) {
remove_filter( $hook, $wp_cli_filter_active_theme, 999 );
}
// Noop memoization added in WP 6.4 again.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WordPress core global.
$GLOBALS['wp_stylesheet_path'] = null;
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WordPress core global.
$GLOBALS['wp_template_path'] = null;
},
0
);
Expand Down