@@ -44,6 +44,9 @@ class Core_Command extends WP_CLI_Command {
4444 * [--major]
4545 * : Compare only the first part of the version number.
4646 *
47+ * [--force-check]
48+ * : Bypass the transient cache and force a fresh update check.
49+ *
4750 * [--field=<field>]
4851 * : Prints the value of a single field for each update.
4952 *
@@ -1145,7 +1148,7 @@ public function update( $args, $assoc_args ) {
11451148 return ;
11461149 }
11471150 } elseif ( ! empty ( $ from_api ->updates ) ) {
1148- list ( $ update ) = $ from_api ->updates ;
1151+ list ( $ update ) = $ from_api ->updates ;
11491152 }
11501153 } elseif ( Utils \wp_version_compare ( $ assoc_args ['version ' ], '< ' )
11511154 || 'nightly ' === $ assoc_args ['version ' ]
@@ -1175,7 +1178,7 @@ public function update( $args, $assoc_args ) {
11751178
11761179 if ( ! empty ( $ update )
11771180 && ( $ update ->version !== $ wp_version
1178- || Utils \get_flag_value ( $ assoc_args , 'force ' ) ) ) {
1181+ || Utils \get_flag_value ( $ assoc_args , 'force ' ) ) ) {
11791182
11801183 require_once ABSPATH . 'wp-admin/includes/upgrade.php ' ;
11811184
@@ -1354,7 +1357,8 @@ private function get_download_url( $version, $locale = 'en_US', $file_type = 'zi
13541357 * Returns update information.
13551358 */
13561359 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 );
13581362 $ from_api = get_site_transient ( 'update_core ' );
13591363 if ( ! $ from_api ) {
13601364 return [];
0 commit comments