is_wp_version_compatible( string $required )

Checks compatibility with the current WordPress version.


Parameters

$required

(string) (Required) Minimum required WordPress version.


Top ↑

Return

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


Top ↑

Source

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


Top ↑

Changelog

Changelog
Version Description
5.2.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.