Skip to content

Commit

Permalink
Add a notice when the min php and wp version is not met
Browse files Browse the repository at this point in the history
  • Loading branch information
ingeniumed committed Sep 12, 2024
1 parent cde5bb5 commit d5e88a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vip-governance.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
if ( ! defined( 'VIP_GOVERNANCE_LOADED' ) ) {
define( 'VIP_GOVERNANCE_LOADED', true );

// ToDo: When 6.4 is our min version, switch to wp_admin_notice.
global $wp_version;
if ( version_compare( phpversion(), '8.0', '<' ) || version_compare( $wp_version, '6.0', '<' ) ) {
add_action( 'admin_notices', function () {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'WordPress VIP Block Governance requires PHP 8.0+ and WordPress 6.0+.', 'vip-governance' ); ?></p>
</div>
<?php
}, 10, 0 );
return;
}

define( 'WPCOMVIP__GOVERNANCE__PLUGIN_VERSION', '1.0.9' );
define( 'WPCOMVIP__GOVERNANCE__RULES_SCHEMA_VERSION', '1.0.0' );

Expand Down

0 comments on commit d5e88a8

Please sign in to comment.