Skip to content

Commit

Permalink
Merge pull request #80 from Automattic/add/min-wp-php-notice
Browse files Browse the repository at this point in the history
Add min php and wp notice
  • Loading branch information
alecgeatches authored Oct 21, 2024
2 parents 3ede143 + 8dcefda commit 8c48174
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions vip-block-data-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Access Gutenberg block data in JSON via the REST API.
* Author: WordPress VIP
* Text Domain: vip-block-data-api
* Version: 1.4.1
* Version: 1.4.2
* Requires at least: 6.0
* Tested up to: 6.6
* Requires PHP: 8.0
Expand All @@ -20,7 +20,20 @@
if ( ! defined( 'VIP_BLOCK_DATA_API_LOADED' ) ) {
define( 'VIP_BLOCK_DATA_API_LOADED', true );

define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.4.1' );
// 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( 'VIP Block Data API requires PHP 8.0+ and WordPress 6.0+.', 'vip-block-data-api' ); ?></p>
</div>
<?php
}, 10, 0 );
return;
}

define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.4.2' );
define( 'WPCOMVIP__BLOCK_DATA_API__REST_ROUTE', 'vip-block-data-api/v1' );

// Analytics related configs.
Expand Down

0 comments on commit 8c48174

Please sign in to comment.