开发者

Wordpress Update Version

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜