函数原型
is_wp_version_compatible( string $required ): bool
函数描述
Checks compatibility with the current WordPress version.
是否弃用
未弃用
函数参数
-
$required
string
Required - Minimum required WordPress version.
函数返回值
bool True if required version is compatible or empty, false if not.
函数位置
File: wp-includes/functions.php.
函数源码
function is_wp_version_compatible( $required ) {
global $wp_version;
// Strip off any -alpha, -RC, -beta, -src suffixes.
list( $version ) = explode( '-', $wp_version );
return empty( $required ) || version_compare( $version, $required, '>=' );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |

