Changeset 47122 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r47111 r47122 431 431 */ 432 432 function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) { 433 // Separates classes with a single space, collates classes for comment DIV 433 // Separates classes with a single space, collates classes for comment DIV. 434 434 $class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"'; 435 435 … … 466 466 } 467 467 468 // Get the comment type (comment, trackback) ,468 // Get the comment type (comment, trackback). 469 469 $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type; 470 470 … … 474 474 $classes[] = 'byuser'; 475 475 $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id ); 476 // For comment authors who are the author of the post 476 // For comment authors who are the author of the post. 477 477 $post = get_post( $post_id ); 478 478 if ( $post ) { … … 502 502 $comment_alt++; 503 503 504 // Alt for top-level comments 504 // Alt for top-level comments. 505 505 if ( 1 == $comment_depth ) { 506 506 if ( $comment_thread_alt % 2 ) { … … 908 908 if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) { 909 909 $text = preg_replace( '#<span class="screen-reader-text">.+?</span>#', '', $more ); 910 $text = preg_replace( '/&.+?;/', '', $text ); // Kill entities 910 $text = preg_replace( '/&.+?;/', '', $text ); // Kill entities. 911 911 $text = trim( strip_tags( $text ), '% ' ); 912 912 913 // Replace '% Comments' with a proper plural form 913 // Replace '% Comments' with a proper plural form. 914 914 if ( $text && ! preg_match( '/[0-9]+/', $text ) && false !== strpos( $more, '%' ) ) { 915 915 /* translators: %s: Number of comments. */ … … 928 928 } elseif ( $number == 0 ) { 929 929 $output = ( false === $zero ) ? __( 'No Comments' ) : $zero; 930 } else { // must be one930 } else { // Must be one. 931 931 $output = ( false === $one ) ? __( '1 Comment' ) : $one; 932 932 } … … 1527 1527 } elseif ( file_exists( TEMPLATEPATH . $file ) ) { 1528 1528 require( TEMPLATEPATH . $file ); 1529 } else { // Backward compat code will be removed in a future release 1529 } else { // Backward compat code will be removed in a future release. 1530 1530 require( ABSPATH . WPINC . '/theme-compat/comments.php' ); 1531 1531 } … … 2053 2053 $parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args ); 2054 2054 2055 // Figure out what comments we'll be looping through ($_comments) 2055 // Figure out what comments we'll be looping through ($_comments). 2056 2056 if ( null !== $comments ) { 2057 2057 $comments = (array) $comments; … … 2177 2177 } 2178 2178 } 2179 // Validation check 2179 // Validation check. 2180 2180 $parsed_args['page'] = intval( $parsed_args['page'] ); 2181 2181 if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) { … … 2453 2453 $args = array_merge( $defaults, $args ); 2454 2454 2455 // Remove aria-describedbyfrom the email field if there's no associated description.2455 // Remove `aria-describedby` from the email field if there's no associated description. 2456 2456 if ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) { 2457 2457 $args['fields']['email'] = str_replace( … … 2555 2555 $comment_fields = apply_filters( 'comment_form_fields', $comment_fields ); 2556 2556 2557 // Get an array of field names, excluding the textarea 2557 // Get an array of field names, excluding the textarea. 2558 2558 $comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) ); 2559 2559 2560 // Get the first and the last field name, excluding the textarea 2560 // Get the first and the last field name, excluding the textarea. 2561 2561 $first_field = reset( $comment_field_keys ); 2562 2562 $last_field = end( $comment_field_keys );
Note: See TracChangeset
for help on using the changeset viewer.