From 48c366c1f48d39839c6e5250d83830198c15166e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 16 Mar 2016 10:20:27 +0000 Subject: [PATCH] Remove several one-time variables from `wp_get_archives()`, added in [24] and [190]. Props pbearne for initial patch. Fixes #36243. Built from https://develop.svn.wordpress.org/trunk@37005 git-svn-id: http://core.svn.wordpress.org/trunk@36972 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 22 +++------------------- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index d3cf27a445..2ba72a38f3 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index dee33750ac..35992b565f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta3-37004'; +$wp_version = '4.5-beta3-37005'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.