PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.89
WindPress – Tailwind CSS integration for WordPress v3.2.89
3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 All 143 releases
← All changes | src/Integration/Timber/Main.php +12 -6 3.0.163.2.89 View file →
@@ -11,8 +11,9 @@
11 11 declare (strict_types=1);
12 12 namespace WindPress\WindPress\Integration\Timber;
13 13
14 14 use WindPress\WindPress\Integration\IntegrationInterface;
15 +use WindPress\WindPress\Utils\Common;
15 16 use WindPress\WindPress\Utils\Config;
16 17 /**
17 18 * @author Joshua Gugun Siagian <suabahasa@gmail.com>
18 19 */
@@ -19,20 +20,25 @@
19 20 class Main implements IntegrationInterface
20 21 {
21 22 public function __construct()
22 23 {
23 - \add_filter('f!windpress/core/cache:compile.providers', fn(array $providers): array => $this->register_provider($providers));
24 + add_filter('f!windpress/core/cache:compile.providers', fn(array $providers): array => $this->register_provider($providers));
24 25 }
25 - public function get_name() : string
26 + public function get_name(): string
26 27 {
27 28 return 'timber';
28 29 }
29 - public function is_enabled() : bool
30 + public function is_enabled(): bool
30 31 {
31 - return (bool) \apply_filters('f!windpress/integration/timber:enabled', Config::get(\sprintf('integration.%s.enabled', $this->get_name()), \true));
32 + return (bool) apply_filters('f!windpress/integration/timber:enabled', Config::get(sprintf('integration.%s.enabled', $this->get_name()), \true));
32 33 }
33 - public function register_provider(array $providers) : array
34 + public function register_provider(array $providers): array
34 35 {
35 - $providers[] = ['id' => $this->get_name(), 'name' => \__('Timber', 'windpress'), 'description' => \__('Timber integration', 'windpress'), 'callback' => \WindPress\WindPress\Integration\Timber\Compile::class];
36 + $providers[] = ['id' => $this->get_name(), 'name' => __('Timber', 'windpress'), 'description' => __('Timber integration', 'windpress'), 'source_index' => 1, 'callback' => Config::get(sprintf('integration.%s.compile.enabled', $this->get_name()), \true) ? \WindPress\WindPress\Integration\Timber\Compile::class : static fn() => [], 'enabled' => $this->is_enabled(), 'type' => 'plugin', 'homepage' => 'https://upstatement.com/timber/?ref=jooosi', 'is_installed_active' => static function () {
37 + $is = -1;
38 + $is += Common::is_plugin_installed('Timber') ? 1 : 0;
39 + $is += Common::is_plugin_active_by_name('Timber') ? 1 : 0;
40 + return $is;
41 + }];
36 42 return $providers;
37 43 }
38 44 }