Make WordPress Core

Ticket #34890: 34890.diff

File 34890.diff, 700 bytes (added by peterwilsoncc, 9 years ago)
  • src/wp-includes/link-template.php

    diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php
    index 5aabffa..1b17329 100644
    a b function rel_canonical() { 
    35023502        $url = get_permalink( $id );
    35033503
    35043504        $page = get_query_var( 'page' );
    3505         if ( $page ) {
    3506                 $url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
     3505        if ( ( $page ) && ( 1 != $page ) ) {
     3506                if ( '' == get_option( 'permalink_structure' ) ) {
     3507                        $url = add_query_arg( 'page', $page, $url );
     3508                }
     3509                else {
     3510                        $url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
     3511                }
    35073512        }
    35083513
    35093514        $cpage = get_query_var( 'cpage' );