Skip to content

Commit

Permalink
🎨 Finalize implementation from #313
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Jan 18, 2025
1 parent 1231ec3 commit 63c25c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public function getSupportAttributes(): array
*/
public function getSupportHtmlAttributes(): array
{
return once(fn () => WP_Block_Supports::get_instance()->apply_block_supports());
return once(fn () => $this->preview ? [] : (WP_Block_Supports::get_instance()?->apply_block_supports() ?? []));
}

/**
Expand All @@ -444,7 +444,7 @@ public function getClasses(): string
return str_replace(
acf_slugify($this->namespace),
$this->slug,
$supports['class'] ?? ''
$supports['class'] ?? "wp-block-{$this->slug}"
);
}

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

$this->classes = $this->getClasses();
$this->style = $this->getStyle();
$this->inlineStyle = ! $this->preview ? $this->getInlineStyle() : '';
$this->inlineStyle = $this->getInlineStyle();

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

0 comments on commit 63c25c6

Please sign in to comment.