Changeset 58335
- Timestamp:
- 06/04/2024 03:27:57 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r57685 r58335 25 25 $comment = get_comment( $comment_id ); 26 26 27 $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_id;27 $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : (string) $comment_id; 28 28 29 29 if ( empty( $comment->comment_author ) ) { -
trunk/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php
r53863 r58335 6 6 */ 7 7 class Tests_Comment_GetCommentAuthorEmailLink extends WP_UnitTestCase { 8 8 9 public static $comment; 9 10 -
trunk/tests/phpunit/tests/comment/getCommentAuthorUrl.php
r54704 r58335 7 7 */ 8 8 class Tests_Comment_GetCommentAuthorUrl extends WP_UnitTestCase { 9 public function get_comment_author_url_filter( $url, $id, $comment ) {10 $this->assertSame( $id, $comment->comment_ID );11 9 12 return $url; 10 private static $comment; 11 12 public static function set_up_before_class() { 13 parent::set_up_before_class(); 14 15 self::$comment = self::factory()->comment->create_and_get( 16 array( 17 'comment_post_ID' => 0, 18 ) 19 ); 20 } 21 22 public function get_comment_author_url_filter( $comment_author_url, $comment_id, $comment ) { 23 $this->assertSame( $comment_id, $comment->comment_ID ); 24 25 return $comment_author_url; 13 26 } 14 27 … … 17 30 */ 18 31 public function test_comment_author_url_passes_correct_comment_id() { 19 $comment = self::factory()->comment->create_and_get(20 array(21 'comment_post_ID' => 0,22 )23 );24 25 32 add_filter( 'get_comment_author_url', array( $this, 'get_comment_author_url_filter' ), 99, 3 ); 26 33 27 get_comment_author_url( $comment ); 28 29 remove_filter( 'get_comment_author_url', array( $this, 'get_comment_author_url_filter' ), 99 ); 34 get_comment_author_url( self::$comment ); 30 35 } 31 36 } -
trunk/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php
r55661 r58335 7 7 */ 8 8 class Tests_Comment_GetCommentAuthorUrlLink extends WP_UnitTestCase { 9 9 10 protected static $comments = array(); 10 11
Note: See TracChangeset
for help on using the changeset viewer.