]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/twentyfourteen/inc/widgets.php
WordPress 4.2
[autoinstalls/wordpress.git] / wp-content / themes / twentyfourteen / inc / widgets.php
index 9bd1e79efd4b194433324b3df8af53db433792a3..fee265ee3c2eef3c074a42ae0ec68d91336a290e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Displays posts from Aside, Quote, Video, Audio, Image, Gallery, and Link formats.
  *
- * @link http://codex.wordpress.org/Widgets_API#Developing_Widgets
+ * @link https://codex.wordpress.org/Widgets_API#Developing_Widgets
  *
  * @package WordPress
  * @subpackage Twenty_Fourteen
@@ -107,7 +107,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
                        echo $args['before_widget'];
                        ?>
                        <h1 class="widget-title <?php echo esc_attr( $format ); ?>">
-                               <a class="entry-format" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php echo $title; ?></a>
+                               <a class="entry-format" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php echo esc_html( $title ); ?></a>
                        </h1>
                        <ol>
 
@@ -149,7 +149,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
                                                                        if ( has_post_thumbnail() ) :
                                                                                $post_thumbnail = get_the_post_thumbnail();
                                                                        elseif ( $total_images > 0 ) :
-                                                                               $image          = array_shift( $images );
+                                                                               $image          = reset( $images );
                                                                                $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );
                                                                        endif;
 
@@ -261,7 +261,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
                        <p><label for="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>"><?php _e( 'Post format to show:', 'twentyfourteen' ); ?></label>
                        <select id="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'format' ) ); ?>">
                                <?php foreach ( $this->formats as $slug ) : ?>
-                               <option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $format, $slug ); ?>><?php echo get_post_format_string( $slug ); ?></option>
+                               <option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $format, $slug ); ?>><?php echo esc_html( get_post_format_string( $slug ) ); ?></option>
                                <?php endforeach; ?>
                        </select>
                <?php