Used $this->isThreaded()
instead as suggested by @MrPetovan
This commit is contained in:
parent
3c50d5b70f
commit
03e09627e4
|
@ -587,16 +587,10 @@ class Post
|
||||||
|
|
||||||
// Copy values/set defaults
|
// Copy values/set defaults
|
||||||
$result['total_comments_num'] = $this->isToplevel() ? $total_children : 0;
|
$result['total_comments_num'] = $this->isToplevel() ? $total_children : 0;
|
||||||
$result['private'] = $item['private'];
|
$result['private'] = $item['private'];
|
||||||
$result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
|
$result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
|
||||||
$result['flatten'] = false;
|
$result['flatten'] = !$this->isThreaded();
|
||||||
$result['threaded'] = false;
|
$result['threaded'] = $this->isThreaded();
|
||||||
|
|
||||||
if ($this->isThreaded()) {
|
|
||||||
$result['threaded'] = true;
|
|
||||||
} else {
|
|
||||||
$result['flatten'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user