• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

timber / timber / 20695674007

04 Jan 2026 04:14PM UTC coverage: 89.681% (+1.5%) from 88.211%
20695674007

push

travis-ci

nlemoine
test: Fix ancestors post tests

4615 of 5146 relevant lines covered (89.68%)

63.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Admin.php
1
<?php
2

3
namespace Timber;
4

5
/**
6
 * Class Admin
7
 */
8
class Admin
9
{
10
    public static function init()
×
11
    {
12
        global $wp_version;
×
13

14
        $minimum_version = '6.0.0';
×
15

16
        // Show notice if user is running something older than the required
17
        // WordPress version.
18
        if (\version_compare($minimum_version, $wp_version) === 1) {
×
19
            $upgrade_url = \admin_url('update-core.php');
×
20

21
            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.");
×
22
        }
23
    }
24

25
    /**
26
     * Display a message in the admin.
27
     *
28
     * @date    01/07/2020
29
     *
30
     * @param string  $text to display
31
     * @param string  $class of the notice 'error' (red) or 'warning' (yellow)
32
     */
33
    protected static function show_notice($text, $class = 'error')
×
34
    {
35
        \add_action('admin_notices', function () use ($text, $class) {
×
36
            echo '<div class="' . $class . '"><p>' . $text . '</p></div>';
×
37
        }, 1);
×
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc