*
* 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
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>
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;
<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