Make WordPress Core

Ticket #31024: 31024.patch

File 31024.patch, 1.4 KB (added by SergeyBiryukov, 11 years ago)
  • src/wp-includes/default-widgets.php

     
    287287                if ( $d ) {
    288288?>
    289289                <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
    290                         <option value=""><?php esc_attr_e( 'Select Month' ); ?></option>
    291 
    292290                        <?php
    293291                        /**
    294292                         * Filter the arguments for the Archives widget drop-down.
     
    299297                         *
    300298                         * @param array $args An array of Archives widget drop-down arguments.
    301299                         */
    302                         wp_get_archives( apply_filters( 'widget_archives_dropdown_args', array(
     300                        $dropdown_args = apply_filters( 'widget_archives_dropdown_args', array(
    303301                                'type'            => 'monthly',
    304302                                'format'          => 'option',
    305303                                'show_post_count' => $c
    306                         ) ) );
    307 ?>
     304                        ) );
     305
     306                        switch ( $dropdown_args['type'] ) {
     307                                case 'yearly':
     308                                        $label = __( 'Select Year' );
     309                                        break;
     310                                case 'monthly':
     311                                        $label = __( 'Select Month' );
     312                                        break;
     313                                case 'daily':
     314                                        $label = __( 'Select Day' );
     315                                        break;
     316                                case 'weekly':
     317                                        $label = __( 'Select Week' );
     318                                        break;
     319                                default:
     320                                        $label = __( 'Select Post' );
     321                                        break;
     322                        }
     323                        ?>
     324
     325                        <option value=""><?php echo esc_attr( $label ); ?></option>
     326                        <?php wp_get_archives( $dropdown_args ); ?>
     327
    308328                </select>
    309329<?php
    310330                } else {