开发者

Wordpress Update Version

开发者 https://www.devze.com 2023-01-06 04:56 出处:网络
Wordpress checks periodically to make sur开发者_如何转开发e that the version of Wordpress being used is the most up to date available... If it\'s not, the latest version number is displayed in the foo

Wordpress checks periodically to make sur开发者_如何转开发e that the version of Wordpress being used is the most up to date available... If it's not, the latest version number is displayed in the footer and in a notice below the header. Does anyone know the variable/constant/option I can use to get this number?

Thanks.


$wp_version is the global variable for the currently running version. If you want to check for new versions, use this (only works in admin by default):

$cur = get_preferred_from_update_core();
if($cur !== false && isset($cur->current) && !empty($cur->current)){
  $new_version = $cur->current;
} else {
  $new_version = "You have the latest version of WordPress!";
}
0

精彩评论

暂无评论...
验证码 换一张
取 消