-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcompatibility.php
62 lines (58 loc) · 1.25 KB
/
compatibility.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* Environment ompatibility checks and notices.
*
* @package Bandstand
* @copyright Copyright (c) 2016, AudioTheme, LLC
* @license GPL-2.0+
* @link https://audiotheme.com/
* @since 1.0.0
*/
/**
* Class for checking environment compatibility.
*
* @package Bandstand
* @since 1.0.0
*/
class Bandstand_Compatibility {
/**
* Minimum PHP version.
*
* @since 1.0.0
* @var string
*/
const MINIMUM_PHP_VERSION = '5.4';
/**
* Display a notice about the minimum PHP version supported.
*
* @since 1.0.0
*/
public static function display_php_version_notice() {
$notice = sprintf(
wp_kses(
__( 'Bandstand requires PHP %s or later to run. Your current version is %s.', 'bandstand' ),
array( 'a' => array( 'href' => true ) )
),
self::MINIMUM_PHP_VERSION,
esc_html( phpversion() )
);
self::display_notice( $notice );
}
/**
* Display an admin notice.
*
* @since 1.0.0
*
* @param string $message Message to print.
* @param string $type Type of notice.
*/
protected static function display_notice( $message, $type = 'error' ) {
?>
<div class="bandstand-compatibility-notice notice notice-<?php echo esc_attr( $type ); ?>">
<p>
<?php echo $message; ?>
</p>
</div>
<?php
}
}