Skip to content

Commit 63c25c6

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Block.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public function getSupportAttributes(): array
421421
*/
422422
public function getSupportHtmlAttributes(): array
423423
{
424-
return once(fn () => WP_Block_Supports::get_instance()->apply_block_supports());
424+
return once(fn () => $this->preview ? [] : (WP_Block_Supports::get_instance()?->apply_block_supports() ?? []));
425425
}
426426

427427
/**
@@ -444,7 +444,7 @@ public function getClasses(): string
444444
return str_replace(
445445
acf_slugify($this->namespace),
446446
$this->slug,
447-
$supports['class'] ?? ''
447+
$supports['class'] ?? "wp-block-{$this->slug}"
448448
);
449449
}
450450

@@ -722,7 +722,7 @@ public function render($block, $content = '', $preview = false, $post_id = 0, $w
722722

723723
$this->classes = $this->getClasses();
724724
$this->style = $this->getStyle();
725-
$this->inlineStyle = ! $this->preview ? $this->getInlineStyle() : '';
725+
$this->inlineStyle = $this->getInlineStyle();
726726

727727
return $this->view($this->view, ['block' => $this]);
728728
}

0 commit comments

Comments
 (0)