Skip to content

Commit bbf5642

Browse files
committed
🎨 Finalize implementation from #313
1 parent 63c25c6 commit bbf5642

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"require": {
1818
"php": "^8.0",
1919
"stoutlogic/acf-builder": "^1.11",
20-
"laravel/prompts": "*",
21-
"spatie/once": "*"
20+
"laravel/prompts": "*"
2221
},
2322
"require-dev": {
2423
"laravel/pint": "^1.14",

src/Block.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,17 +419,21 @@ public function getSupportAttributes(): array
419419
/**
420420
* Retrieve the block HTML attributes.
421421
*/
422-
public function getSupportHtmlAttributes(): array
422+
public function getHtmlAttributes(): array
423423
{
424-
return once(fn () => $this->preview ? [] : (WP_Block_Supports::get_instance()?->apply_block_supports() ?? []));
424+
if ($this->preview) {
425+
return [];
426+
}
427+
428+
return WP_Block_Supports::get_instance()?->apply_block_supports() ?? [];
425429
}
426430

427431
/**
428432
* Retrieve the inline block styles.
429433
*/
430434
public function getInlineStyle(): string
431435
{
432-
$supports = $this->getSupportHtmlAttributes();
436+
$supports = $this->getHtmlAttributes();
433437

434438
return $supports['style'] ?? '';
435439
}
@@ -439,7 +443,7 @@ public function getInlineStyle(): string
439443
*/
440444
public function getClasses(): string
441445
{
442-
$supports = $this->getSupportHtmlAttributes();
446+
$supports = $this->getHtmlAttributes();
443447

444448
return str_replace(
445449
acf_slugify($this->namespace),

0 commit comments

Comments
 (0)