Make WordPress Core

Ticket #31024: 31024.diff

File 31024.diff, 1.5 KB (added by westonruter, 11 years ago)
  • src/wp-includes/default-widgets.php

    diff --git src/wp-includes/default-widgets.php src/wp-includes/default-widgets.php
    index 180e074..a037288 100644
    class WP_Widget_Archives extends WP_Widget { 
    285285                }
    286286
    287287                if ( $d ) {
    288 ?>
    289                 <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
    290                         <option value=""><?php esc_attr_e( 'Select Month' ); ?></option>
    291 
    292                         <?php
    293288                        /**
    294289                         * Filter the arguments for the Archives widget drop-down.
    295290                         *
    class WP_Widget_Archives extends WP_Widget { 
    299294                         *
    300295                         * @param array $args An array of Archives widget drop-down arguments.
    301296                         */
    302                         wp_get_archives( apply_filters( 'widget_archives_dropdown_args', array(
     297                        $args = apply_filters( 'widget_archives_dropdown_args', array(
    303298                                'type'            => 'monthly',
    304299                                'format'          => 'option',
    305300                                'show_post_count' => $c
    306                         ) ) );
     301                        ) );
     302
     303?>
     304                <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
     305                        <option value=""><?php
     306                                if ( 'monthly' === $args['type'] ) {
     307                                        esc_attr_e( 'Select Month' );
     308                                } else if ( 'yearly' === $args['type'] ) {
     309                                        esc_attr_e( 'Select Year' );
     310                                } else if ( 'daily' === $args['type'] ) {
     311                                        esc_attr_e( 'Select Day' );
     312                                } else if ( 'weekly' === $args['type'] ) {
     313                                        esc_attr_e( 'Select Week' );
     314                                } else {
     315                                        esc_attr_e( 'Select' );
     316                                }
     317                        ?></option>
     318
     319                        <?php
     320                        wp_get_archives( $args );
    307321?>
    308322                </select>
    309323<?php