@@ -44,6 +44,9 @@ class Core_Command extends WP_CLI_Command {
44
44
* [--major]
45
45
* : Compare only the first part of the version number.
46
46
*
47
+ * [--force-check]
48
+ * : Bypass the transient cache and force a fresh update check.
49
+ *
47
50
* [--field=<field>]
48
51
* : Prints the value of a single field for each update.
49
52
*
@@ -1145,7 +1148,7 @@ public function update( $args, $assoc_args ) {
1145
1148
return ;
1146
1149
}
1147
1150
} elseif ( ! empty ( $ from_api ->updates ) ) {
1148
- list ( $ update ) = $ from_api ->updates ;
1151
+ list ( $ update ) = $ from_api ->updates ;
1149
1152
}
1150
1153
} elseif ( Utils \wp_version_compare ( $ assoc_args ['version ' ], '< ' )
1151
1154
|| 'nightly ' === $ assoc_args ['version ' ]
@@ -1175,7 +1178,7 @@ public function update( $args, $assoc_args ) {
1175
1178
1176
1179
if ( ! empty ( $ update )
1177
1180
&& ( $ update ->version !== $ wp_version
1178
- || Utils \get_flag_value ( $ assoc_args , 'force ' ) ) ) {
1181
+ || Utils \get_flag_value ( $ assoc_args , 'force ' ) ) ) {
1179
1182
1180
1183
require_once ABSPATH . 'wp-admin/includes/upgrade.php ' ;
1181
1184
@@ -1354,7 +1357,8 @@ private function get_download_url( $version, $locale = 'en_US', $file_type = 'zi
1354
1357
* Returns update information.
1355
1358
*/
1356
1359
private function get_updates ( $ assoc_args ) {
1357
- wp_version_check ();
1360
+ $ force_check = Utils \get_flag_value ( $ assoc_args , 'force-check ' );
1361
+ wp_version_check ( [], $ force_check );
1358
1362
$ from_api = get_site_transient ( 'update_core ' );
1359
1363
if ( ! $ from_api ) {
1360
1364
return [];
0 commit comments