Skip to content

Commit 59ca578

Browse files
swissspidyCopilot
andauthored
Update src/Core_Command.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ad2183d commit 59ca578

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Core_Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,11 +1271,11 @@ public function update( $args, $assoc_args ) {
12711271
}
12721272
} else {
12731273
// Check if user attempted to downgrade without --force
1274-
if ( ! empty( $assoc_args['version'] ) && version_compare( $assoc_args['version'], $wp_version, '<' ) ) {
1274+
if ( ! empty( Utils\get_flag_value( $assoc_args, 'version' ) ) && version_compare( Utils\get_flag_value( $assoc_args, 'version' ), $wp_version, '<' ) ) {
12751275
// Requested version is older than current (downgrade attempt)
12761276
WP_CLI::log( "WordPress is up to date at version {$wp_version}." );
12771277
WP_CLI::log( "The version you requested (" . Utils\get_flag_value( $assoc_args, 'version' ) . ") is older than the current version ({$wp_version})." );
1278-
WP_CLI::log( "Use --force to update anyway (e.g., to downgrade to version {$assoc_args['version']})." );
1278+
WP_CLI::log( "Use --force to update anyway (e.g., to downgrade to version " . Utils\get_flag_value( $assoc_args, 'version' ) . ")." );
12791279
} else {
12801280
WP_CLI::success( "WordPress is up to date at version {$wp_version}." );
12811281
}

0 commit comments

Comments
 (0)