Skip to content

Commit

Permalink
fix: Update admin notice for minimum required WordPress version (#3001)
Browse files Browse the repository at this point in the history
  • Loading branch information
gchtr committed May 15, 2024
1 parent 456c24e commit 66e92a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 8 additions & 4 deletions src/Admin.php
Expand Up @@ -10,12 +10,16 @@ class Admin
public static function init()
{
global $wp_version;
if (\version_compare('5.3.0', $wp_version) === 1) {
// user is running something older that WordPress 5.3 show them an error

$minimum_version = '6.0.0';

// Show notice if user is running something older than the required
// WordPress version.
if (\version_compare($minimum_version, $wp_version) === 1) {
$upgrade_url = \admin_url('update-core.php');
self::show_notice("<a href='https://github.com/timber/timber'>Timber 2.0</a> requires <strong>WordPress 5.3</strong> or greater, but you are running <strong>WordPress $wp_version</strong>. Please <a href='$upgrade_url'>upgrade WordPress</a> in order to use Timber 2.0.");

self::show_notice("<a href='https://github.com/timber/timber'>Timber 2.0</a> requires <strong>WordPress $minimum_version</strong> or greater, but you are running <strong>WordPress $wp_version</strong>. Please <a href='$upgrade_url'>update WordPress</a> in order to use Timber 2.0.");
}
return true;
}

/**
Expand Down
12 changes: 0 additions & 12 deletions tests/test-timber-admin.php

This file was deleted.

0 comments on commit 66e92a5

Please sign in to comment.