find_core_update()
最后更新于:2021-11-26 04:07:22
find_core_update( string$version, string$locale)Finds the available update for GeChiUI core.
参数
- $version
-
(string) (Required) Version string to find the update for.
- $locale
-
(string) (Required) Locale to find the update for.
响应
(object|false) The core update offering on success, false on failure.
源文件
文件: gc-admin/includes/update.php
function find_core_update( $version, $locale ) {
$from_api = get_site_transient( 'update_core' );
if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
return false;
}
$updates = $from_api->updates;
foreach ( $updates as $update ) {
if ( $update->current == $version && $update->locale == $locale ) {
return $update;
}
}
return false;
}