Template: In `wp_get_archives()` use `add_query_arg()` instead of `sprintf()` to build the archive URL.

Props tloureiro.
Fixes #36414.
Built from https://develop.svn.wordpress.org/trunk@37530


git-svn-id: http://core.svn.wordpress.org/trunk@37498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-05-23 10:23:30 +00:00
parent e5dd89ae57
commit fa6346e409
2 changed files with 2 additions and 2 deletions

View File

@ -1790,7 +1790,7 @@ function wp_get_archives( $args = '' ) {
$arc_week = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) ); $arc_week = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) );
$arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] ); $arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );
$arc_week_end = date_i18n( get_option( 'date_format' ), $arc_week['end'] ); $arc_week_end = date_i18n( get_option( 'date_format' ), $arc_week['end'] );
$url = sprintf( '%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $result->week ); $url = add_query_arg( array( 'm' => $arc_year, 'w' => $result->week, ), home_url( '/' ) );
if ( 'post' !== $r['post_type'] ) { if ( 'post' !== $r['post_type'] ) {
$url = add_query_arg( 'post_type', $r['post_type'], $url ); $url = add_query_arg( 'post_type', $r['post_type'], $url );
} }

View File

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