Skip to content

Commit 01096a5

Browse files
🩹 Fix block type registration in WordPress 6.8 (#344)
1 parent 8daa981 commit 01096a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Block.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ public function compose()
271271
'category' => $this->category,
272272
'icon' => $this->icon,
273273
'keywords' => $this->keywords,
274-
'parent' => $this->parent ?: [],
275274
'post_types' => $this->post_types,
276275
'mode' => $this->mode,
277276
'align' => $this->align,
@@ -294,6 +293,10 @@ public function compose()
294293
},
295294
];
296295

296+
if (filled($this->parent)) {
297+
$settings = Arr::add($settings, 'parent', $this->parent);
298+
}
299+
297300
if ($this->example !== false) {
298301
$settings = Arr::add($settings, 'example', [
299302
'attributes' => [

0 commit comments

Comments
 (0)