* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare (strict_types=1); namespace WindPress\WindPress\Integration\Kadence; use WindPress\WindPress\Integration\IntegrationInterface; use WindPress\WindPress\Utils\Config; /** * Tested with Kadence theme version 1.2.9 and Kadence Blocks version 3.2.52 * @author Joshua Gugun Siagian */ class Main implements IntegrationInterface { public function __construct() { \add_filter('f!windpress/core/cache:compile.providers', fn(array $providers): array => $this->register_provider($providers)); if ($this->is_enabled()) { (new \WindPress\WindPress\Integration\Kadence\Compile())(); } } public function get_name() : string { return 'kadence'; } public function is_enabled() : bool { return (bool) \apply_filters('f!windpress/integration/kadence:enabled', Config::get(\sprintf('integration.%s.enabled', $this->get_name()), \true)); } public function register_provider(array $providers) : array { $providers[] = ['id' => $this->get_name(), 'name' => \__('Kadence WP', 'windpress'), 'description' => \__('The Kadence WP integration. It requires the Gutenberg/Block Editor integration enabled.', 'windpress'), 'callback' => fn() => [], 'enabled' => $this->is_enabled(), 'meta' => ['experimental' => \true]]; return $providers; } }