Skip to content

Commit b34f0ee

Browse files
committed
(fix): extended cpt dependency check
1 parent fe4eab4 commit b34f0ee

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## Version 4.2.9
4+
5+
- Fix: extended cpt dependency check
6+
37
## Version 4.2.8
48

59
- Fix: translations just in time error

config/dependencies.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
'version' => '2.10.1',
2222
'file' => 'cmb2/init.php',
2323
],
24-
[
25-
'type' => 'class',
26-
'label' => '<a href="https://github.com/johnbillion/extended-cpts" target="_blank">Extended CPT library</a>',
27-
'name' => 'Extended_CPT',
28-
]
24+
[
25+
'type' => 'function',
26+
'label' => '<a href="https://github.com/johnbillion/extended-cpts" target="_blank">Extended CPT library</a>',
27+
'name' => 'register_extended_post_type'
28+
]
2929
],
3030
'suggested' => [
3131
[

openwoo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Plugin Name: Yard | OpenWOO
77
* Plugin URI: https://www.yard.nl/
88
* Description: Voegt de OpenWOO functionaliteit toe aan de website.
9-
* Version: 4.2.8
9+
* Version: 4.2.9
1010
* Author: Yard | Digital Agency
1111
* Author URI: https://www.yard.nl/
1212
* License: EUPL-1.2
@@ -29,7 +29,7 @@
2929
define('OWO_SLUG', basename(__FILE__, '.php'));
3030
define('OWO_DIR', basename(__DIR__));
3131
define('OWO_ROOT_PATH', __DIR__);
32-
define('OWO_VERSION', '4.2.8');
32+
define('OWO_VERSION', '4.2.9');
3333

3434
/**
3535
* Manual loaded file: the autoloader.

src/OpenWOO/Foundation/DependencyChecker.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function hasFailures(): bool
4040
$this->checkPlugin($dependency);
4141

4242
break;
43+
case 'function':
44+
45+
$this->checkFunction($dependency);
46+
break;
4347
}
4448
}
4549

@@ -180,6 +184,16 @@ private function checkPlugin(array $dependency): void
180184
}
181185
}
182186

187+
/**
188+
* Checks if required function exists.
189+
*/
190+
private function checkFunction(array $dependency): void
191+
{
192+
if (! function_exists($dependency['name'])) {
193+
$this->markFailed($dependency, __('Function does not exist:', 'openwoo') . ' <b>' . $dependency['name'] . '</b>');
194+
}
195+
}
196+
183197
protected function checkPluginActive(array $dependency): bool
184198
{
185199
$files = $dependency['file'];

0 commit comments

Comments
 (0)