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

timber / timber / 5690057835

pending completion
5690057835

push

github

nlemoine
Merge branch '2.x' of github.com:timber/timber into 2.x-refactor-file-models

# Conflicts:
#	src/Attachment.php
#	src/ExternalImage.php
#	src/FileSize.php
#	src/URLHelper.php

1134 of 1134 new or added lines in 55 files covered. (100.0%)

3923 of 4430 relevant lines covered (88.56%)

59.08 hits per line

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

28.57
/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
        if (\version_compare('5.3.0', $wp_version) === 1) {
1✔
14
            // user is running something older that WordPress 5.3 show them an error
15
            $upgrade_url = \admin_url('update-core.php');
×
16
            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.");
×
17
        }
18
        return true;
1✔
19
    }
20

21
    /**
22
     * Display a message in the admin.
23
     *
24
     * @date    01/07/2020
25
     *
26
     * @param string  $text to display
27
     * @param string  $class of the notice 'error' (red) or 'warning' (yellow)
28
     */
29
    protected static function show_notice($text, $class = 'error')
30
    {
31
        \add_action('admin_notices', function () use ($text, $class) {
×
32
            echo '<div class="' . $class . '"><p>' . $text . '</p></div>';
×
33
        }, 1);
×
34
    }
35
}
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

© 2025 Coveralls, Inc