Make WordPress Core

Changeset 36103


Ignore:
Timestamp:
12/27/2015 02:11:56 AM (9 years ago)
Author:
dd32
Message:

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

Merges [36096] to the 4.4 branch.
Props peterwilsoncc.
Fixes #34890.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/link-template.php

    r35704 r36103  
    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.