Make WordPress Core

Ticket #20088: 20088.diff

File 20088.diff, 5.3 KB (added by lancewillett, 12 years ago)
  • wp-includes/comment-template.php

     
    12451245                        case 'div':
    12461246                                break;
    12471247                        case 'ol':
    1248                                 echo "<ol class='children'>\n";
     1248                                echo '<ol class="children">' . "\n";
    12491249                                break;
    12501250                        default:
    12511251                        case 'ul':
    1252                                 echo "<ul class='children'>\n";
     1252                                echo '<ul class="children">' . "\n";
    12531253                                break;
    12541254                }
    12551255        }
     
    12691269                        case 'div':
    12701270                                break;
    12711271                        case 'ol':
    1272                                 echo "</ol>\n";
     1272                                echo "</ol><!-- .children -->\n";
    12731273                                break;
    12741274                        default:
    12751275                        case 'ul':
    1276                                 echo "</ul>\n";
     1276                                echo "</ul><!-- .children -->\n";
    12771277                                break;
    12781278                }
    12791279        }
     
    13301330                $depth++;
    13311331                $GLOBALS['comment_depth'] = $depth;
    13321332
    1333                 if ( !empty($args['callback']) ) {
    1334                         call_user_func($args['callback'], $comment, $args, $depth);
     1333                if ( !empty( $args['callback'] ) ) {
     1334                        call_user_func( $args['callback'], $comment, $args, $depth );
    13351335                        return;
    13361336                }
    13371337
    13381338                $GLOBALS['comment'] = $comment;
    1339                 extract($args, EXTR_SKIP);
     1339                extract( $args, EXTR_SKIP );
    13401340
    13411341                if ( 'div' == $args['style'] ) {
    13421342                        $tag = 'div';
     
    13451345                        $tag = 'li';
    13461346                        $add_below = 'div-comment';
    13471347                }
    1348 ?>
    1349                 <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
    1350                 <?php if ( 'div' != $args['style'] ) : ?>
    1351                 <div id="div-comment-<?php comment_ID() ?>" class="comment-body">
    1352                 <?php endif; ?>
    1353                 <div class="comment-author vcard">
    1354                 <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
    1355                 <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
    1356                 </div>
    1357 <?php if ($comment->comment_approved == '0') : ?>
    1358                 <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em>
    1359                 <br />
    1360 <?php endif; ?>
    13611348
    1362                 <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
    1363                         <?php
    1364                                 /* translators: 1: date, 2: time */
    1365                                 printf( __('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','' );
    1366                         ?>
    1367                 </div>
     1349                switch ( $comment->comment_type ) :
     1350                        case 'pingback' :
     1351                        case 'trackback' :
     1352                        // Display trackbacks differently than normal comments.
     1353                ?>
     1354                <<?php echo $tag ?> <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
     1355                        <p><?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)' ), '<span class="edit-link">', '</span>' ); ?></p>
     1356                <?php
     1357                                break;
     1358                        default :
     1359                        // Proceed with normal comments.
     1360                ?>
     1361                <<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?> id="comment-<?php comment_ID(); ?>">
     1362                        <?php if ( 'div' != $args['style'] ) : ?>
     1363                        <div id="div-comment-<?php comment_ID(); ?>">
     1364                        <?php endif; ?>
     1365                                <div class="comment-meta comment-author vcard">
     1366                                        <?php
     1367                                                if ( 0 != $args['avatar_size'] )
     1368                                                        echo get_avatar( $comment, $args['avatar_size'] );
    13681369
    1369                 <?php comment_text() ?>
     1370                                                /* translators: 1: comment author, 2: date and time */
     1371                                                printf( __( '%1$s on %2$s <span class="says">said:</span>' ),
     1372                                                        sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
     1373                                                        sprintf( '<a href="%1$s">%2$s</a>',
     1374                                                                esc_url( get_comment_link( $comment->comment_ID ) ),
     1375                                                                /* translators: 1: date, 2: time */
     1376                                                                sprintf( __( '%1$s at %2$s' ), get_comment_date(), get_comment_time() )
     1377                                                        )
     1378                                                );
     1379                                        ?>
     1380                                        <?php edit_comment_link( __( '(Edit)' ), '<span class="edit-link">', '</span>' ); ?>
     1381                                </div><!-- .comment-meta -->
    13701382
    1371                 <div class="reply">
    1372                 <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    1373                 </div>
    1374                 <?php if ( 'div' != $args['style'] ) : ?>
    1375                 </div>
    1376                 <?php endif; ?>
    1377 <?php
     1383                                <?php if ( '0' == $comment->comment_approved ) : ?>
     1384                                        <p class="comment-awaiting-moderation"><em><?php _e( 'Your comment is awaiting moderation.' ); ?></em><p>
     1385                                <?php endif; ?>
     1386
     1387                                <div class="comment-body">
     1388                                        <?php comment_text(); ?>
     1389                                </div><!-- .comment_text -->
     1390
     1391                                <div class="reply">
     1392                                        <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
     1393                                </div><!-- .reply -->
     1394                        <?php if ( 'div' != $args['style'] ) : ?>
     1395                        </div><!-- div-comment-## -->
     1396                        <?php endif;
     1397
     1398                        break;
     1399                endswitch; // end comment_type check
    13781400        }
    13791401
    13801402        /**
     
    13861408         * @param int $depth Depth of comment.
    13871409         * @param array $args
    13881410         */
    1389         function end_el(&$output, $comment, $depth = 0, $args = array() ) {
    1390                 if ( !empty($args['end-callback']) ) {
    1391                         call_user_func($args['end-callback'], $comment, $args, $depth);
     1411        function end_el( &$output, $comment, $depth = 0, $args = array() ) {
     1412                if ( !empty( $args['end-callback'] ) ) {
     1413                        call_user_func( $args['end-callback'], $comment, $args, $depth );
    13921414                        return;
    13931415                }
    13941416                if ( 'div' == $args['style'] )
    1395                         echo "</div>\n";
     1417                        echo "</div><!-- #comment-## -->\n";
    13961418                else
    1397                         echo "</li>\n";
     1419                        echo "</li><!-- #comment-## -->\n";
    13981420        }
    1399 
    14001421}
    14011422
    14021423/**