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

Props wonderboymusic, joostdevalk.
See #11694.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-24 14:30:24 +00:00
parent 0fc9bed46e
commit 9405b8b10e
2 changed files with 9 additions and 3 deletions

View File

@ -3455,8 +3455,14 @@ function rel_canonical() {
$url = get_permalink( $id );
if ( $page = get_query_var('cpage') ) {
$url = get_comments_pagenum_link( $page );
$page = get_query_var( 'page' );
if ( $page ) {
$url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
}
$cpage = get_query_var( 'cpage' );
if ( $cpage ) {
$url = get_comments_pagenum_link( $cpage );
}
echo '<link rel="canonical" href="' . esc_url( $url ) . "\" />\n";
}

View File

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