wp-content/themes/twentytwelve/functions.php:472Template for comments and pingbacks.
$commentWP_Comment$argsarray$depthint function twentytwelve_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback': case 'trackback': // Display trackbacks differently than normal comments. ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p> <?php break; default: // Proceed with normal comments. global $post; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>" class="comment"> <header class="comment-meta comment-author vcard"> <?php echo get_avatar( $comment, 44 ); printf( '<cite><b class="fn">%1$s</b> %2$s</cite>', get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : '' ); printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: Date, 2: Time. */ sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() ) ); ?> </header><!-- .comment-meta --> <?php $commenter = wp_get_current_commenter(); if ( $commenter['comment_author_email'] ) { $moderation_note = __( 'Your comment is awaiting moderation.', 'twentytwelve' ); } else { $moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'twentytwelve' ); } ?> <?php if ( '0' === $comment->comment_approved ) : ?> <p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p> <?php endif; ?> <section class="comment-content comment"> <?php comment_text(); ?> <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?> </section><!-- .comment-content --> <div class="reply"> <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'], ) ) ); ?> </div><!-- .reply --> </article><!-- #comment-## --> <?php break; endswitch; // End comment_type check. }Introduced in Twenty Twelve 1.0. 3 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$comment retyped from untyped to WP_Comment.verified against source$args retyped from untyped to array.verified against source$depth retyped from untyped to int.verified against sourcesrc/wp-content/themes/twentytwelve/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.