File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 23
23
},
24
24
"files" : [
25
25
" includes/enqueues.php" ,
26
- " includes/query-loop.php"
26
+ " includes/query-loop.php" ,
27
+ " includes/utilities.php"
27
28
]
28
29
},
29
30
"require-dev" : {
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Handles enqueueing of assets for the plugin.
4
+ *
5
+ * @package AdvancedQueryLoop/Utils
6
+ */
7
+
8
+ namespace AdvancedQueryLoop \Utils ;
9
+
10
+ /**
11
+ * Helper to determine if the Gutenberg plugin is installed and if so, if it is at or higher a given version.
12
+ *
13
+ * @param string $version The version to check for.
14
+ *
15
+ * @return boolean.
16
+ */
17
+ function is_gutenberg_plugin_version_or_higher ( string $ version ) {
18
+ if ( defined ( 'IS_GUTENBERG_PLUGIN ' ) && defined ( 'GUTENBERG_VERSION ' ) ) {
19
+ // This means the plugin is installed
20
+ return version_compare ( GUTENBERG_VERSION , $ version , '>= ' );
21
+ }
22
+ return false ;
23
+ }
24
+
25
+ /**
26
+ * Helper to determine is the current WP install is at or higher than a given version.
27
+ *
28
+ * @param string $version The version to check for.
29
+
30
+ * @return boolean.
31
+ */
32
+ function is_core_version_or_higher ( string $ version ) {
33
+ $ core = get_bloginfo ( 'version ' );
34
+ return version_compare ( $ core , $ version , '>= ' );
35
+ }
36
+
You can’t perform that action at this time.
0 commit comments