diff --git a/composer.json b/composer.json index 5f96686..e1290a6 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,7 @@ "require": { "php": "^8.0", "stoutlogic/acf-builder": "^1.11", - "laravel/prompts": "*", - "spatie/once": "*" + "laravel/prompts": "*" }, "require-dev": { "laravel/pint": "^1.14", diff --git a/src/Block.php b/src/Block.php index d81b2b7..c7ae01b 100644 --- a/src/Block.php +++ b/src/Block.php @@ -419,9 +419,13 @@ public function getSupportAttributes(): array /** * Retrieve the block HTML attributes. */ - public function getSupportHtmlAttributes(): array + public function getHtmlAttributes(): array { - return once(fn () => $this->preview ? [] : (WP_Block_Supports::get_instance()?->apply_block_supports() ?? [])); + if ($this->preview) { + return []; + } + + return WP_Block_Supports::get_instance()?->apply_block_supports() ?? []; } /** @@ -429,7 +433,7 @@ public function getSupportHtmlAttributes(): array */ public function getInlineStyle(): string { - $supports = $this->getSupportHtmlAttributes(); + $supports = $this->getHtmlAttributes(); return $supports['style'] ?? ''; } @@ -439,7 +443,7 @@ public function getInlineStyle(): string */ public function getClasses(): string { - $supports = $this->getSupportHtmlAttributes(); + $supports = $this->getHtmlAttributes(); return str_replace( acf_slugify($this->namespace),