forked from ryanwelcher/advanced-query-loop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilities.php
36 lines (31 loc) · 919 Bytes
/
utilities.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
<?php
/**
* Handles enqueueing of assets for the plugin.
*
* @package AdvancedQueryLoop/Utils
*/
namespace AdvancedQueryLoop\Utils;
/**
* Helper to determine if the Gutenberg plugin is installed and if so, if it is at or higher a given version.
*
* @param string $version The version to check for.
*
* @return boolean.
*/
function is_gutenberg_plugin_version_or_higher( string $version ) {
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && defined( 'GUTENBERG_VERSION' ) ) {
// This means the plugin is installed
return version_compare( GUTENBERG_VERSION, $version, '>=' );
}
return false;
}
/**
* Helper to determine is the current WP install is at or higher than a given version.
*
* @param string $version The version to check for.
* @return boolean.
*/
function is_core_version_or_higher( string $version ) {
$core = get_bloginfo( 'version' );
return version_compare( $core, $version, '>=' );
}