Automattic\WooCommerce\EmailEditorVendor\Sabberworm\CSS

OutputFormatter::comments │ public │ WC 1.0

  • @param array<Commentable> $aComments
  • @return string

Метод класса: OutputFormatter{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$OutputFormatter = new OutputFormatter();
$OutputFormatter->comments( $oCommentable );
$oCommentable(Commentable) (обязательный)
.

Код OutputFormatter::comments() WC 11.3.0

public function comments(Commentable $oCommentable)
{
    if (!$this->oFormat->bRenderComments) {
        return '';
    }

    $sResult = '';
    $aComments = $oCommentable->getComments();
    $iLastCommentIndex = count($aComments) - 1;

    foreach ($aComments as $i => $oComment) {
        $sResult .= $oComment->render($this->oFormat);
        $sResult .= $i === $iLastCommentIndex ? $this->spaceAfterBlocks() : $this->spaceBetweenBlocks();
    }
    return $sResult;
}