WordPress.org

Make WordPress Core

Changeset 36096


Ignore:
Timestamp:
12/26/2015 04:27:43 AM (5 years ago)
Author:
dd32
Message:

Canonical: Output correct canonical links for paged posts when not using pretty permalinks.

Props peterwilsoncc.
Fixes #34890

File:
1 edited

Legend:

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

    r36079 r36096  
    35033503
    35043504    $page = get_query_var( 'page' );
    3505     if ( $page ) {
    3506         $url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
     3505    if ( $page >= 2 ) {
     3506        if ( '' == get_option( 'permalink_structure' ) ) {
     3507            $url = add_query_arg( 'page', $page, $url );
     3508        } else {
     3509            $url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
     3510        }
    35073511    }
    35083512
Note: See TracChangeset for help on using the changeset viewer.