- Timestamp:
- 04/05/2020 03:00:44 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r45932 r47550 72 72 */ 73 73 public function widget( $args, $instance ) { 74 $format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside'; 74 $format = isset( $instance['format'] ) ? $instance['format'] : ''; 75 76 if ( ! $format || ! in_array( $format, $this->formats, true ) ) { 77 $format = 'aside'; 78 } 75 79 76 80 switch ( $format ) { … … 106 110 } 107 111 108 $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); 109 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); 112 $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2; 113 $title = ! empty( $instance['title'] ) ? $instance['title'] : $format_string; 114 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 110 115 111 116 $ephemera = new WP_Query( … … 266 271 $instance['title'] = strip_tags( $new_instance['title'] ); 267 272 $instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); 268 if ( in_array( $new_instance['format'], $this->formats ) ) { 273 274 if ( in_array( $new_instance['format'], $this->formats, true ) ) { 269 275 $instance['format'] = $new_instance['format']; 270 276 } … … 281 287 */ 282 288 function form( $instance ) { 283 $title = empty( $instance['title'] ) ? '' : esc_attr( $instance['title'] ); 284 $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); 285 $format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside'; 289 $title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 290 $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2; 291 $format = isset( $instance['format'] ) ? $instance['format'] : ''; 292 293 if ( ! $format || ! in_array( $format, $this->formats, true ) ) { 294 $format = 'aside'; 295 } 286 296 ?> 287 297 <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyfourteen' ); ?></label>
Note: See TracChangeset
for help on using the changeset viewer.