Changeset 52818
- Timestamp:
- 03/03/2022 08:32:20 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r52223 r52818 23 23 */ 24 24 function get_comment_author( $comment_ID = 0 ) { 25 $comment = get_comment( $comment_ID ); 25 $comment = get_comment( $comment_ID ); 26 $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_ID; 26 27 27 28 if ( empty( $comment->comment_author ) ) { 28 $user = $comment->user_id? get_userdata( $comment->user_id ) : false;29 $user = ! empty( $comment->user_id ) ? get_userdata( $comment->user_id ) : false; 29 30 if ( $user ) { 30 31 $author = $user->display_name; … … 46 47 * @param WP_Comment $comment The comment object. 47 48 */ 48 return apply_filters( 'get_comment_author', $author, $comment ->comment_ID, $comment );49 return apply_filters( 'get_comment_author', $author, $comment_ID, $comment ); 49 50 } 50 51 … … 664 665 */ 665 666 function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 666 $comment = get_comment(); 667 $comment = get_comment(); 668 $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0'; 667 669 668 670 /** … … 675 677 * @param WP_Comment $comment The comment object. 676 678 */ 677 return apply_filters( 'get_comment_ID', $comment ->comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase679 return apply_filters( 'get_comment_ID', $comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 678 680 } 679 681
Note: See TracChangeset
for help on using the changeset viewer.