WordPress at a glance

is_wp_version_compatible() WP 1.0

Checks compatibility with the current WordPress version.

1 time — 0.000001 sec (speed of light) | 50000 times — 0.03 sec (speed of light) | PHP 7.2.16, WP 5.2

No Hooks.

Return

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

Usage

is_wp_version_compatible( $required );
$required(string) (required)
Minimum required WordPress version.

Changelog

Since 5.2.0 Introduced.

Code of is_wp_version_compatible() WP 5.7.2

<?php
function is_wp_version_compatible( $required ) {
	return empty( $required ) || version_compare( get_bloginfo( 'version' ), $required, '>=' );
}
No comments
    Log In