diff --git a/src/Binding/Hookable.php b/src/Binding/Hookable.php index 3fb1e51b46ee5f6e4a0a9c410e5453bce0acb0eb..0ed2900b0e9a17c940866129f2ccbf55f7818e7f 100644 --- a/src/Binding/Hookable.php +++ b/src/Binding/Hookable.php @@ -4,7 +4,15 @@ declare(strict_types=1); namespace WPDesk\Init\Binding; -interface Hookable extends \WPDesk\PluginBuilder\Plugin\Hookable { - - public function hooks(): void; +/** + * Operate in mode compatible with wp-builder library, as wp-init roots on it and needs to preserve the easy way to upgrade existing clients. + */ +if ( class_exists( \WPDesk\PluginBuilder\Plugin\Hookable::class ) ) { + interface Hookable extends \WPDesk\PluginBuilder\Plugin\Hookable { + public function hooks(): void; + } +} else { + interface Hookable { + public function hooks(): void; + } }