Skip to content

Commit 941cfaf

Browse files
author
Andrei Igna
committed
Fixed - handle meta boxes for comments
1 parent a81852a commit 941cfaf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/MetaFields.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,12 @@ public function addColumnContent($content, $columnName, $objId = null): string {
262262

263263
/* 3. Add meta boxes */
264264

265-
public function addPostMetaBoxes(string $postType, \WP_Post $post) {
266-
$metaFields = $this->metaFields['post'][$postType] ?? [];
265+
public function addPostMetaBoxes(string $postType, $post) {
266+
if ($postType === 'comment') {
267+
$metaFields = $this->metaFields['comment'] ?? [];
268+
} else {
269+
$metaFields = $this->metaFields['post'][$postType] ?? [];
270+
}
267271
$metaFieldsByGroup = [];
268272

269273
foreach ($metaFields as $metaKey => $metaField) {

0 commit comments

Comments
 (0)