Skip to content

Commit

Permalink
Add name
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebuchy committed Aug 24, 2020
1 parent 1597207 commit 9f48d34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ public function compose()
*/
public function render($block, $content = '', $preview = false, $post_id = 0)
{
$this->set_id(); $this->block = (object) $block;
$this->set_id();

$this->block = (object) $block;
$this->content = $content;
$this->preview = $preview;

Expand All @@ -279,11 +281,11 @@ public function render($block, $content = '', $preview = false, $post_id = 0)

$this->classes = collect([
'slug' => Str::start(
$this->block->slug,
Str::replaceFirst('acf/', '', $this->block->name),
'wp-block-'
),
'custom-slug' => Str::start(
$this->block->slug,
Str::replaceFirst('acf/', '', $this->block->name),
'b-'
),
'align' => ! empty($this->block->align) ?
Expand Down

0 comments on commit 9f48d34

Please sign in to comment.