wordpress / latest / functions / is_wp_version_compatible.html

is_wp_version_compatible( string $required ): bool

Checks compatibility with the current WordPress version.

Parameters

$required string Required
Minimum required WordPress version.

Return

bool True if required version is compatible or empty, false if not.

Source

File: wp-includes/functions.php. View all references

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

Used By

Used By Description

Changelog

Version Description
5.2.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_wp_version_compatible