Changeset 45787
- Timestamp:
- 08/13/2019 05:08:14 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r45742 r45787 1698 1698 'unapproved' => false, 1699 1699 'moderation-hash' => false, 1700 ) 1700 ), 1701 get_permalink( $post->ID ) 1701 1702 ) 1702 1703 ) . '#' . $args['respond_id'], -
trunk/tests/phpunit/tests/comment/getCommentReplyLink.php
r42343 r45787 27 27 $this->assertNull( get_comment_reply_link( $args ) ); 28 28 } 29 30 /** 31 * Ensure comment reply links include post permalink. 32 * 33 * @ticket 47174 34 */ 35 public function test_get_comment_reply_link_should_include_post_permalink() { 36 // Create a sample post. 37 $post_id = self::factory()->post->create(); 38 39 // Insert comment. 40 $comment_id = self::factory()->comment->create( 41 array( 42 'comment_post_ID' => $post_id, 43 'user_id' => 1, 44 ) 45 ); 46 47 // `depth` and `max_depth` required for reply links to display. 48 $comment_reply_link = get_comment_reply_link( 49 array( 50 'depth' => 1, 51 'max_depth' => 5, 52 ), 53 $comment_id, 54 $post_id 55 ); 56 57 $expected_url = esc_url( 58 add_query_arg( 59 array( 60 'p' => $post_id, 61 'replytocom' => $comment_id, 62 ), 63 home_url( '/#respond' ) 64 ) 65 ); 66 67 $this->assertContains( $expected_url, $comment_reply_link ); 68 } 29 69 }
Note: See TracChangeset
for help on using the changeset viewer.