Habari\Theme::theme_comments_count PHP Метод

theme_comments_count() публичный Метод

Passed strings are localized prior to parsing therefore to localize "%d Comments" in french, it would be "%d Commentaires". Since we use sprintf() in the final concatenation, you must format passed strings accordingly.
public theme_comments_count ( Theme $theme, Post $post, string $zero = '', string $one = '', string $many = '' ) : string
$theme Theme The current theme object
$post Post Post object used to build the comments link
$zero string String to return when there are no comments
$one string String to return when there is one comment
$many string String to return when there are more than one comment
Результат string String to display for comment count
    public function theme_comments_count($theme, $post, $zero = '', $one = '', $many = '')
    {
        $count = $post->comments->approved->count;
        if ($count == 0) {
            $text = empty($zero) ? _t('No Comments') : $zero;
            return sprintf($text, $count);
        } else {
            if (empty($one) && empty($many)) {
                $text = _n('%s Comment', '%s Comments', $count);
            } else {
                if (empty($one)) {
                    $one = $many;
                }
                if (empty($many)) {
                    $many = $one;
                }
                $text = $count == 1 ? $one : $many;
            }
            return sprintf($text, $count);
        }
    }