comment functions updated to current 2010, now working
This commit is contained in:
parent
3052a115a1
commit
16c13dae1d
@ -165,34 +165,66 @@ if ( ! function_exists( 'melville_comment' ) ) :
|
|||||||
* Used as a callback by wp_list_comments() for displaying the comments.
|
* Used as a callback by wp_list_comments() for displaying the comments.
|
||||||
*
|
*
|
||||||
* @since Twenty Ten 1.0
|
* @since Twenty Ten 1.0
|
||||||
|
*
|
||||||
|
* @param WP_Comment $comment The comment object.
|
||||||
|
* @param array $args An array of arguments. @see get_comment_reply_link()
|
||||||
|
* @param int $depth The depth of the comment.
|
||||||
*/
|
*/
|
||||||
function melville_comment( $comment, $args, $depth ) {
|
function melville_comment( $comment, $args, $depth ) {
|
||||||
$GLOBALS['comment'] = $comment;
|
$GLOBALS['comment'] = $comment;
|
||||||
switch ( $comment->comment_type ) :
|
switch ( $comment->comment_type ) :
|
||||||
case '':
|
case '':
|
||||||
|
case 'comment':
|
||||||
?>
|
?>
|
||||||
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
||||||
<div id="comment-<?php comment_ID(); ?>">
|
<div id="comment-<?php comment_ID(); ?>">
|
||||||
<div class="comment-author vcard">
|
<div class="comment-author vcard">
|
||||||
<?php echo get_avatar( $comment, 40 ); ?>
|
<?php echo get_avatar( $comment, 40 ); ?>
|
||||||
<?php printf( __( '%s <span class="says">said:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
|
<?php
|
||||||
|
/* translators: %s: Author display name. */
|
||||||
|
printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) );
|
||||||
|
?>
|
||||||
</div><!-- .comment-author .vcard -->
|
</div><!-- .comment-author .vcard -->
|
||||||
<?php if ( $comment->comment_approved == '0' ) : ?>
|
|
||||||
<em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
|
<?php
|
||||||
|
$commenter = wp_get_current_commenter();
|
||||||
|
if ( $commenter['comment_author_email'] ) {
|
||||||
|
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentyten' );
|
||||||
|
} else {
|
||||||
|
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'twentyten' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php if ( '0' == $comment->comment_approved ) : ?>
|
||||||
|
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
|
||||||
<br />
|
<br />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
|
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
|
||||||
<?php
|
<?php
|
||||||
/* translators: 1: date, 2: time */
|
/* translators: 1: Date, 2: Time. */
|
||||||
printf( __( '%1$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
|
printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() );
|
||||||
|
?>
|
||||||
|
</a>
|
||||||
|
<?php
|
||||||
|
edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
|
||||||
?>
|
?>
|
||||||
</div><!-- .comment-meta .commentmetadata -->
|
</div><!-- .comment-meta .commentmetadata -->
|
||||||
|
|
||||||
<div class="comment-body"><?php comment_text(); ?></div>
|
<div class="comment-body"><?php comment_text(); ?></div>
|
||||||
|
|
||||||
<div class="reply">
|
<div class="reply">
|
||||||
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
|
<?php
|
||||||
|
comment_reply_link(
|
||||||
|
array_merge(
|
||||||
|
$args,
|
||||||
|
array(
|
||||||
|
'depth' => $depth,
|
||||||
|
'max_depth' => $args['max_depth'],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
</div><!-- .reply -->
|
</div><!-- .reply -->
|
||||||
</div><!-- #comment-## -->
|
</div><!-- #comment-## -->
|
||||||
|
|
||||||
@ -209,6 +241,7 @@ function melville_comment( $comment, $args, $depth ) {
|
|||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the default styles that are packaged with the Recent Comments widget.
|
* Removes the default styles that are packaged with the Recent Comments widget.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user