is_wp_version_compatible() WordPress Function

The is_wp_version_compatible() function is used to check if a specific WordPress version is compatible with the current WordPress installation.

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
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More