Ticket #27069: 27069.2.2.patch
File 27069.2.2.patch, 3.5 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentyfourteen/inc/widgets.php
24 24 private $formats = array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery' ); 25 25 26 26 /** 27 * Pluralized post format strings.28 *29 * @access private30 * @since Twenty Fourteen 1.031 *32 * @var array33 */34 private $format_strings;35 36 /**37 27 * Constructor. 38 28 * 39 29 * @since Twenty Fourteen 1.0 … … 45 35 'classname' => 'widget_twentyfourteen_ephemera', 46 36 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts', 'twentyfourteen' ), 47 37 ) ); 48 49 /*50 * @todo http://core.trac.wordpress.org/ticket/23257: Add plural versions of Post Format strings51 */52 $this->format_strings = array(53 'aside' => __( 'Asides', 'twentyfourteen' ),54 'image' => __( 'Images', 'twentyfourteen' ),55 'video' => __( 'Videos', 'twentyfourteen' ),56 'audio' => __( 'Audio', 'twentyfourteen' ),57 'quote' => __( 'Quotes', 'twentyfourteen' ),58 'link' => __( 'Links', 'twentyfourteen' ),59 'gallery' => __( 'Galleries', 'twentyfourteen' ),60 );61 38 } 62 39 63 40 /** … … 72 49 */ 73 50 public function widget( $args, $instance ) { 74 51 $format = $instance['format']; 52 53 switch ( $format ) { 54 case 'aside': 55 $format_string = __( 'Asides', 'twentyfourteen' ); 56 $format_string_more = __( 'More aside', 'twentyfourteen' ); 57 break; 58 59 case 'image': 60 $format_string = __( 'Images', 'twentyfourteen' ); 61 $format_string_more = __( 'More images', 'twentyfourteen' ); 62 break; 63 64 case 'video': 65 $format_string = __( 'Videos', 'twentyfourteen' ); 66 $format_string_more = __( 'More videos', 'twentyfourteen' ); 67 break; 68 69 case 'audio': 70 $format_string = __( 'Audio', 'twentyfourteen' ); 71 $format_string_more = __( 'More audio', 'twentyfourteen' ); 72 break; 73 74 case 'quote': 75 $format_string = __( 'Quotes', 'twentyfourteen' ); 76 $format_string_more = __( 'More quotes', 'twentyfourteen' ); 77 break; 78 79 case 'link': 80 $format_string = __( 'Links', 'twentyfourteen' ); 81 $format_string_more = __( 'More links', 'twentyfourteen' ); 82 break; 83 84 case 'gallery': 85 $format_string = __( 'Galleries', 'twentyfourteen' ); 86 $format_string_more = __( 'More galleries', 'twentyfourteen' ); 87 break; 88 89 default: 90 break; 91 92 } 93 94 75 95 $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); 76 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $ this->format_strings[ $format ]: $instance['title'], $instance, $this->id_base );96 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); 77 97 78 98 $ephemera = new WP_Query( array( 79 99 'order' => 'DESC', … … 191 211 <?php endwhile; ?> 192 212 193 213 </ol> 194 <a class="post-format-archive-link" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php printf( __( ' More %s <span class="meta-nav">→</span>', 'twentyfourteen' ), $this->format_strings[ $format ]); ?></a>214 <a class="post-format-archive-link" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php printf( __( '%s <span class="meta-nav">→</span>', 'twentyfourteen' ), $format_string_more ); ?></a> 195 215 <?php 196 216 197 217 echo $args['after_widget'];