有get_core_updates()
.
请注意,如果在前端等运行,您可能需要手动包含声明它的管理文件。
示例使用:
require_once ABSPATH . \'/wp-admin/includes/update.php\';
print_r( get_core_updates() );
返回示例:
Array
(
[0] => stdClass Object
(
[response] => latest
[download] => http://wordpress.org/wordpress-3.4.2.zip
[locale] => en_US
[packages] => stdClass Object
(
[full] => http://wordpress.org/wordpress-3.4.2.zip
[no_content] => http://wordpress.org/wordpress-3.4.2-no-content.zip
[new_bundled] => http://wordpress.org/wordpress-3.4.2-new-bundled.zip
[partial] =>
)
[current] => 3.4.2
[php_version] => 5.2.4
[mysql_version] => 5.0
[new_bundled] => 3.2
[partial_version] =>
[dismissed] =>
)
)