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

Props peterwilsoncc.
Fixes #34890

Built from https://develop.svn.wordpress.org/trunk@36096


git-svn-id: http://core.svn.wordpress.org/trunk@36061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-12-26 04:28:26 +00:00
parent 1d19b930fc
commit 67c5150ba6
2 changed files with 7 additions and 3 deletions

View File

@ -3502,9 +3502,13 @@ function rel_canonical() {
$url = get_permalink( $id );
$page = get_query_var( 'page' );
if ( $page ) {
if ( $page >= 2 ) {
if ( '' == get_option( 'permalink_structure' ) ) {
$url = add_query_arg( 'page', $page, $url );
} else {
$url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
}
}
$cpage = get_query_var( 'cpage' );
if ( $cpage ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36095';
$wp_version = '4.5-alpha-36096';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.