mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-25 09:28:42 +00:00
Canonical: Output correct canonical links for paged posts when not using pretty permalinks.
Merges [36096] to the 4.4 branch. Props peterwilsoncc. Fixes #34890. Built from https://develop.svn.wordpress.org/branches/4.4@36103 git-svn-id: http://core.svn.wordpress.org/branches/4.4@36068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4680a9a281
commit
1879fa6413
@ -3502,8 +3502,12 @@ function rel_canonical() {
|
||||
$url = get_permalink( $id );
|
||||
|
||||
$page = get_query_var( 'page' );
|
||||
if ( $page ) {
|
||||
$url = trailingslashit( $url ) . user_trailingslashit( $page, 'single_paged' );
|
||||
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' );
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4.1-alpha-36101';
|
||||
$wp_version = '4.4.1-alpha-36103';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user