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 a notice when the min WP version is not met #32

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
vendor
*.php
dist
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this in the typescript PR so adding it in

8 changes: 4 additions & 4 deletions vip-workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

define( 'VIP_WORKFLOW_LOADED', true );

// ToDo: Add a check for the WP version as well.
// ToDo: When 6.4 is our min version, switch to wp_admin_notice.
if ( version_compare( phpversion(), '8.0', '<' ) ) {
global $wp_version;
if ( version_compare( phpversion(), '8.0', '<' ) || version_compare( $wp_version, '6.2', '<' ) ) {
add_action( 'admin_notices', function () {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'VIP Workflow requires PHP 8.0+.', 'vip-workflow' ); ?></p>
</div>
<p><?php esc_html_e( 'VIP Workflow requires PHP 8.0+ and WordPress 6.2+.', 'vip-workflow' ); ?></p>
</div>
<?php
}, 10, 0 );
return;
Expand Down