WordPress.org

Make WordPress Core

Changeset 37530


Ignore:
Timestamp:
05/23/2016 10:22:36 AM (3 years ago)
Author:
ocean90
Message:

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

Props tloureiro.
Fixes #36414.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r37498 r37530  
    17911791                    $arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );
    17921792                    $arc_week_end   = date_i18n( get_option( 'date_format' ), $arc_week['end'] );
    1793                     $url            = sprintf( '%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $result->week );
     1793                    $url            = add_query_arg( array( 'm' => $arc_year, 'w' => $result->week, ), home_url( '/' ) );
    17941794                    if ( 'post' !== $r['post_type'] ) {
    17951795                        $url = add_query_arg( 'post_type', $r['post_type'], $url );
Note: See TracChangeset for help on using the changeset viewer.