';
printf( // WPCS: XSS OK.
esc_html( _nx( 'Comment (%1$s)', 'Comments (%1$s)', $comments_number, 'comments title', 'razzi' ) ),
number_format_i18n( $comments_number )
);
echo '';
}
/**
* No comment
*
* @since 1.0.0
*
* @return void
*/
public function comment_fields() {
if ( ! comments_open() ) {
echo '
';
} else {
$comment_field = '';
comment_form(
array(
'format' => 'xhtml',
'comment_field' => $comment_field,
)
);
}
}
/**
* Loop content
*
* @since 1.0.0
*
* @return void
*/
public function comment_content() {
echo '';
}
/**
* Custom fields comment form
*
* @since 1.0
*
* @return array $fields
*/
public function comment_form_fields() {
global $commenter, $aria_req;
$comment_author = isset($commenter['comment_author']) ? $commenter['comment_author'] : '';
$comment_author_email = isset($commenter['comment_author_email']) ? $commenter['comment_author_email'] : '';
$comment_author_url = isset($commenter['comment_author_url']) ? $commenter['comment_author_url'] : '';
$fields = array(
'author' => '',
'email' => '',
'url' => ''
);
return $fields;
}
/**
* Comment callback function
*
* @since 1.0.0
*
* @param object $comment
* @param array $args
* @param int $depth
*
* @return string
*/
public function razzi_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
extract( $args, EXTR_SKIP );
$avatar = '';
if ( $args['avatar_size'] != 0 ) {
$avatar = get_avatar( $comment, $args['avatar_size'] );
}
$classes = get_comment_class( empty( $args['has_children'] ) ? '' : 'parent' );
$classes = $classes ? implode( ' ', $classes ) : $classes;
$comments = array(
'comment_parent' => 0,
'comment_ID' => get_comment_ID(),
'comment_class' => $classes,
'comment_avatar' => $avatar,
'comment_author_link' => get_comment_author_link(),
'comment_link' => get_comment_link( get_comment_ID() ),
'comment_date' => get_comment_date(),
'comment_time' => get_comment_time(),
'comment_approved' => $comment->comment_approved,
'comment_text' => get_comment_text(),
'comment_reply' => get_comment_reply_link( array_merge( $args, array(
'add_below' => 'comment',
'depth' => $depth,
'max_depth' => $args['max_depth']
) ) )
);
$comment = $this->comment_template( $comments );
echo ! empty( $comment ) ? $comment : '';
}
/**
* Comment Template function
*
* @since 1.0.0
*
* @param object $comment
*
* @return string
*/
public function comment_template( $comments ) {
$output = array();
$output[] = sprintf( '