HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/itself.kauko.lt/wp-content/themes/pally/classes/class-ally-walker-comment.php
<?php
/**
 * Custom comment walker for this theme
 *
 * @package WordPress
 * @subpackage pally
 * @since pally 1.0
 */

/**
 * This class outputs custom comment walker for HTML5 friendly WordPress comment and threaded replies.
 *
 * @since pally 1.0
 */
class Pally_Walker_Comment extends Walker_Comment {

	/**
	 * Outputs a comment in the HTML5 format.
	 *
	 * @see wp_list_comments()
	 *
	 * @param WP_Comment $comment Comment to display.
	 * @param int        $depth   Depth of the current comment.
	 * @param array      $args    An array of arguments.
	 */
	protected function html5_comment( $comment, $depth, $args ) {

		$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';

		?>
		<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
			<div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
				<footer class="comment-meta">
					<div class="comment-author vcard">
						<div class="avatar">
						<?php
						$comment_author_url = get_comment_author_url( $comment );
						$comment_author     = get_comment_author( $comment );
						$avatar             = get_avatar( $comment, $args['avatar_size'] );
						if ( 0 != $args['avatar_size'] ) {
							echo $avatar;
						}
						?>
						</div>
						<div class="authorname">
						<?php

						if ( empty( $comment_author_url ) ) {
							printf(
								wp_kses(
									/* translators: %s: Comment author link. */
									__( '%s <span class="screen-reader-text says">says:</span>', 'pally' ),
									array(
										'span' => array(
											'class' => array(),
										),
									)
								),
								$comment_author
							);
						} else {
							printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
							printf(
								wp_kses(
									/* translators: %s: Comment author link. */
									__( '%s <span class="screen-reader-text says">says:</span>', 'pally' ),
									array(
										'span' => array(
											'class' => array(),
										),
									)
								),
								$comment_author
							);
						}

						if ( ! empty( $comment_author_url ) ) {
							echo '</a>';
						}
						?>
					</div>
					</div><!-- .comment-author -->

					<div class="comment-metadata">

							<?php
								/* translators: 1: Comment date, 2: Comment time. */
								$comment_timestamp = sprintf( __( 'on %1$s,  %2$s', 'pally' ), get_comment_date( '', $comment ), get_comment_time() );
							?>
							<time datetime="<?php comment_time( 'c' ); ?>" title="<?php echo $comment_timestamp; ?>">
								<?php echo $comment_timestamp; ?>
							</time>
					</div><!-- .comment-metadata -->

					<?php
					$commenter = wp_get_current_commenter();
					if ( $commenter['comment_author_email'] ) {
						$moderation_note = __( 'Your comment is awaiting moderation.', 'pally' );
					} else {
						$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'pally' );
					}
					?>

					<?php if ( '0' == $comment->comment_approved ) : ?>
					<p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p>
					<?php endif; ?>

				</footer><!-- .comment-meta -->

				<div class="comment-content">
					<?php comment_text(); ?>
				</div><!-- .comment-content -->

			</div><!-- .comment-body -->

			<?php
			comment_reply_link(
				array_merge(
					$args,
					array(
						'add_below' => 'div-comment',
						'depth'     => $depth,
						'max_depth' => $args['max_depth'],
						'before'    => '<div class="comment-reply">',
						'after'     => '</div>',
					)
				)
			);
			?>
		<?php
	}
}