Changeset 53278 for trunk/src/wp-includes/blocks/comment-template.php
- Timestamp:
- 04/26/2022 01:39:57 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/comment-template.php
r53219 r53278 8 8 /** 9 9 * Function that recursively renders a list of nested comments. 10 * 11 * @global int $comment_depth 10 12 * 11 13 * @param WP_Comment[] $comments The array of comments. … … 32 34 $children = $comment->get_children(); 33 35 36 /* 37 * We need to create the CSS classes BEFORE recursing into the children. 38 * This is because comment_class() uses globals like `$comment_alt` 39 * and `$comment_thread_alt` which are order-sensitive. 40 * 41 * The `false` parameter at the end means that we do NOT want the function 42 * to `echo` the output but to return a string. 43 * See https://developer.wordpress.org/reference/functions/comment_class/#parameters. 44 */ 45 $comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false ); 46 34 47 // If the comment has children, recurse to create the HTML for the nested 35 48 // comments. … … 43 56 $comment_depth -= 1; 44 57 } 45 46 // The `false` parameter at the end means that we do NOT want the function to `echo` the output but to return a string.47 // See https://developer.wordpress.org/reference/functions/comment_class/#parameters.48 $comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false );49 58 50 59 $content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content );
Note: See TracChangeset
for help on using the changeset viewer.