Remove several one-time variables from `wp_get_archives()`, added in [24] and [190].

Props pbearne for initial patch.
Fixes #36243.

git-svn-id: https://develop.svn.wordpress.org/trunk@37005 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2016-03-16 10:19:43 +00:00
parent e76e55af2e
commit e86930f864
1 changed files with 3 additions and 19 deletions

View File

@ -1679,22 +1679,6 @@ function wp_get_archives( $args = '' ) {
// this is what will separate dates on weekly archive links
$archive_week_separator = '–';
// over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride
$archive_date_format_over_ride = 0;
// options for daily archive (only if you over-ride the general date format)
$archive_day_date_format = 'Y/m/d';
// options for weekly archive (only if you over-ride the general date format)
$archive_week_start_date_format = 'Y/m/d';
$archive_week_end_date_format = 'Y/m/d';
if ( ! $archive_date_format_over_ride ) {
$archive_day_date_format = get_option( 'date_format' );
$archive_week_start_date_format = get_option( 'date_format' );
$archive_week_end_date_format = get_option( 'date_format' );
}
$sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $r['post_type'] );
/**
@ -1788,7 +1772,7 @@ function wp_get_archives( $args = '' ) {
$url = add_query_arg( 'post_type', $r['post_type'], $url );
}
$date = sprintf( '%1$d-%2$02d-%3$02d 00:00:00', $result->year, $result->month, $result->dayofmonth );
$text = mysql2date( $archive_day_date_format, $date );
$text = mysql2date( get_option( 'date_format' ), $date );
if ( $r['show_post_count'] ) {
$r['after'] = ' (' . $result->posts . ')' . $after;
}
@ -1812,8 +1796,8 @@ function wp_get_archives( $args = '' ) {
$arc_year = $result->yr;
$arc_w_last = $result->week;
$arc_week = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) );
$arc_week_start = date_i18n( $archive_week_start_date_format, $arc_week['start'] );
$arc_week_end = date_i18n( $archive_week_end_date_format, $arc_week['end'] );
$arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );
$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 );
if ( 'post' !== $r['post_type'] ) {
$url = add_query_arg( 'post_type', $r['post_type'], $url );