如果您可以从服务器访问文件,只需包括wp-includes/version.php
从每个安装。该文件是完全独立的,它只定义了五个变量:
/**
* The WordPress version string
*
* @global string $wp_version
*/
$wp_version = \'3.5.1\';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 22441;
/**
* Holds the TinyMCE version
*
* @global string $tinymce_version
*/
$tinymce_version = \'358-23224\';
/**
* Holds the required PHP version
*
* @global string $required_php_version
*/
$required_php_version = \'5.2.4\';
/**
* Holds the required MySQL version
*
* @global string $required_mysql_version
*/
$required_mysql_version = \'5.0\';
一个简单的
version_compare()
将实现以下目的:
if ( \'-1\' == version_compare( $wp_version, \'3.5.1\' ) )
return \'outdated\';