Skip to content

Commit 754159d

Browse files
committed
Added version check for wordpress-toolkit
1 parent 1505fd1 commit 754159d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

app/Plugin.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ private function verify_dependencies( $deps = true, $args = array() ) {
140140
}
141141
break;
142142

143+
case 'wordpress-toolkit':
144+
145+
$wordpress_toolkit_version = defined( '\WordPress_ToolKit\VERSION' ) ? \WordPress_ToolKit\VERSION : null;
146+
147+
if( !$wordpress_toolkit_version || version_compare( $wordpress_toolkit_version, $version, '<' ) ) {
148+
$notices[] = sprintf( __( 'Unable to activate %s. An outdated version of WordPress ToolKit has been detected: %s (&gt;= %s required)', self::$textdomain ), self::$config->get( 'plugin/meta/Name' ), $wordpress_toolkit_version, $version );
149+
}
150+
break;
151+
143152
case 'carbon_fields':
144153

145154
//if( defined('\\Carbon_Fields\\VERSION') || ( defined('\\Carbon_Fields\\VERSION') && version_compare( \Carbon_Fields\VERSION, $version, '<' ) ) ) {

plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
},
88
"dependencies": {
99
"php": "5.6",
10-
"carbon_fields": "2.1.1"
10+
"carbon_fields": "2.1.1",
11+
"wordpress-toolkit": "0.1.3"
1112
},
1213
"encrypt_method": "AES-128-ECB"
1314
}

0 commit comments

Comments
 (0)