get_preferred_from_update_core

函式
get_preferred_from_update_core ( No parameters )
返回值
  • (object|array|false) The response from the API on success, false on failure.
定義位置
相關方法
get_gmt_from_datewp_update_core_maybe_update_coreget_registered_metadataget_feed_build_date
引入
2.7.0
棄用
-

get_preferred_from_update_core函式是一個WordPress函式,它從WordPress核心更新包中檢索一個指定檔案的首選版本: 這個函式把檔名作為引數,並返回指定檔案的首選版本。

從update_core選項中選擇第一個更新版本。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_preferred_from_update_core() {
$updates = get_core_updates();
if ( ! is_array( $updates ) ) {
return false;
}
if ( empty( $updates ) ) {
return (object) array( 'response' => 'latest' );
}
return $updates[0];
}
function get_preferred_from_update_core() { $updates = get_core_updates(); if ( ! is_array( $updates ) ) { return false; } if ( empty( $updates ) ) { return (object) array( 'response' => 'latest' ); } return $updates[0]; }
function get_preferred_from_update_core() {
	$updates = get_core_updates();
	if ( ! is_array( $updates ) ) {
		return false;
	}
	if ( empty( $updates ) ) {
		return (object) array( 'response' => 'latest' );
	}
	return $updates[0];
}

常見問題

FAQs
檢視更多 >