is_wp_version_compatible

函数


is_wp_version_compatible ( $required )
参数
  • (string)
    $required
    Minimum required WordPress version.
    Required:
返回值
  • (bool) True if required version is compatible or empty, false if not.
定义位置
  • wp-includes/functions.php
    , line 8399
引入
5.2.0
弃用

Checks compatibility with the current WordPress version.

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, '>=' );
}