2010-07-07 66 views
0

WordPress的定期检查,以确保正在使用的WordPress的版本是最新的可用...如果不是,最新版本号显示在页脚和标题下的通知。有谁知道我可以用来获得这个数字的变量/常量/选项?WordPress的更新版本

谢谢。

回答

1

$wp_version是当前运行版本的全局变量。如果您想检查新版本,请使用此选项(默认情况下只能在管理员中使用):

$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!"; 
}