<?php global $wp_version; $wp_version = '6.9-beta2-61080-src'; function is_wp_version_compatible( $required ) { global $wp_version; // Strip off any -alpha, -RC, -beta, -src suffixes. list( $version ) = explode( '-', $wp_version ); if ( is_string( $required ) ) { $trimmed = trim( $required ); if ( substr_count( $trimmed, '.' ) > 1 && str_ends_with( $trimmed, '.0' ) ) { $required = substr( $trimmed, 0, -2 ); } } return empty( $required ) || version_compare( $version, $required, '>=' ); } $tests = [ '6.9', '6.9.2', '6.8.3, '6.8.4-beta', '5.4' ]; print_r( array_combine( $tests ), array_map( 'is_wp_version_compatible', $tests ) );
You have javascript disabled. You will not be able to edit any code.