From a0b98480ca82119e04ab6029ef8a75dca1ead7f8 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 22 Jan 2018 21:18:58 -0600 Subject: [PATCH] Issue #864: Make 'Archives' widget dropdown AMP-compliant. Props @westonruter for describing how to do this. Like before, it mainly copies WP_Widget_Archives::widget(). It adds an id to the
. And an 'on' attribute to the + 'monthly', + 'format' => 'option', + 'show_post_count' => $c, + ) ); + + switch ( $dropdown_args['type'] ) { + case 'yearly': + $label = __( 'Select Year', 'default' ); + break; + case 'monthly': + $label = __( 'Select Month', 'default' ); + break; + case 'daily': + $label = __( 'Select Day', 'default' ); + break; + case 'weekly': + $label = __( 'Select Week', 'default' ); + break; + default: + $label = __( 'Select Post', 'default' ); + break; + } + ?> + + + +
+ + + diff --git a/tests/test-class-amp-widget-media-audio.php b/tests/test-class-amp-widget-media-audio.php index 758b58f9c0c..c66aee65a05 100644 --- a/tests/test-class-amp-widget-media-audio.php +++ b/tests/test-class-amp-widget-media-audio.php @@ -50,7 +50,7 @@ public function test_construct() { */ public function test_render_media() { $widget = new AMP_Widget_Media_Audio(); - $audio = '/tmp/small-audio.mp3'; + $audio = '/tmp/small-audio.mp3'; copy( DIR_TESTDATA . '/uploads/small-audio.mp3', $audio ); $attachment_id = self::factory()->attachment->create_object( array( 'file' => $audio,