WordPress.org

Make WordPress Core

Changeset 34496


Ignore:
Timestamp:
09/24/2015 02:30:00 PM (4 years ago)
Author:
wonderboymusic
Message:

Canonical/Rewrite: After [34492], fix rel="canonical" URLs for paginated posts.

Props wonderboymusic, joostdevalk.
See #11694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r34452 r34496  
    34563456    $url = get_permalink( $id );
    34573457
    3458     if ( $page = get_query_var('cpage') ) {
    3459         $url = get_comments_pagenum_link( $page );
     3458    $page = get_query_var( 'page' );
     3459    if ( $page ) {
     3460        $url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
     3461    }
     3462
     3463    $cpage = get_query_var( 'cpage' );
     3464    if ( $cpage ) {
     3465        $url = get_comments_pagenum_link( $cpage );
    34603466    }
    34613467    echo '<link rel="canonical" href="' . esc_url( $url ) . "\" />\n";
Note: See TracChangeset for help on using the changeset viewer.