Skip to content

Commit

Permalink
Merge pull request #86 from Automattic/add/min-wp-php-notice
Browse files Browse the repository at this point in the history
Add a notice when the minimum PHP or WordPress version are not met
  • Loading branch information
alecgeatches authored Sep 13, 2024
2 parents 62c08c6 + d5e88a8 commit 03afe98
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 03afe98

Please sign in to comment.