mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Permalinks: Limit pagination for posts with comments.
Additionally, redirect pages back to the source page if comments don't exist. Props devrekli, carike, sumanm, mukesh27, chaion07, audrasjb, whyisjake, SergeyBiryukov. Fixes #50233. git-svn-id: https://develop.svn.wordpress.org/trunk@51118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -151,6 +151,27 @@ class Tests_Link_wpGetCanonicalUrl extends WP_UnitTestCase {
|
||||
$this->assertSame( $this->canonical_url_filter(), $canonical_url );
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit pagination for comments.
|
||||
*
|
||||
* @ticket 50233
|
||||
*/
|
||||
public function test_comments_limit_paged_with_plain_permalink_structure() {
|
||||
$cpage = 5;
|
||||
|
||||
$link = add_query_arg(
|
||||
array(
|
||||
'cpage' => $cpage,
|
||||
'foo' => 'bar',
|
||||
),
|
||||
get_permalink( self::$post_id )
|
||||
);
|
||||
|
||||
$this->go_to( $link );
|
||||
$expected = get_permalink( self::$post_id ) . '#comments';
|
||||
$this->assertSame( $expected, wp_get_canonical_url( self::$post_id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter callback for testing of filter usage.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user