Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add min php and wp notice #80

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading