diff --git a/modules/widgets/authors.php b/modules/widgets/authors.php
index f365c3b1a0eff..741856d84ccc1 100644
--- a/modules/widgets/authors.php
+++ b/modules/widgets/authors.php
@@ -172,22 +172,20 @@ public function widget( $args, $instance ) {
continue;
}
- // Display a short list of recent posts for this author
-
+ // Display a short list of recent posts for this author.
if ( $r->have_posts() ) {
echo '
';
diff --git a/modules/widgets/top-posts.php b/modules/widgets/top-posts.php
index 442dddd7b0be8..9a80439235298 100644
--- a/modules/widgets/top-posts.php
+++ b/modules/widgets/top-posts.php
@@ -406,11 +406,16 @@ function widget( $args, $instance ) {
*/
$filtered_permalink = apply_filters( 'jetpack_top_posts_widget_permalink', $post['permalink'], $post );
- ?>
-
-
-
- ',
+ esc_url( $filtered_permalink ),
+ esc_attr( wp_kses( $post['title'], array() ) ),
+ ( get_queried_object_id() === $post['post_id'] ? ' aria-current="page"' : '' ),
+ absint( $width ),
+ absint( $height ),
+ esc_url( $post['image'] )
+ );
+
/**
* Fires after each Top Post result, inside .
*
@@ -437,16 +442,24 @@ function widget( $args, $instance ) {
/** This filter is documented in modules/widgets/top-posts.php */
$filtered_permalink = apply_filters( 'jetpack_top_posts_widget_permalink', $post['permalink'], $post );
- ?>
-
-
-
-
-
+ %7$s
+
+ ',
+ esc_url( $filtered_permalink ),
+ esc_attr( wp_kses( $post['title'], array() ) ),
+ ( get_queried_object_id() === $post['post_id'] ? ' aria-current="page"' : '' ),
+ absint( $width ),
+ absint( $height ),
+ esc_url( $post['image'] ),
+ esc_html( wp_kses( $post['title'], array() ) )
+ );
+
/** This action is documented in modules/widgets/top-posts.php */
do_action( 'jetpack_widget_top_posts_after_post', $post['post_id'] );
?>
@@ -467,11 +480,14 @@ function widget( $args, $instance ) {
/** This filter is documented in modules/widgets/top-posts.php */
$filtered_permalink = apply_filters( 'jetpack_top_posts_widget_permalink', $post['permalink'], $post );
- ?>
-
-
-
- %3$s',
+ esc_url( $filtered_permalink ),
+ ( get_queried_object_id() === $post['post_id'] ? ' aria-current="page"' : '' ),
+ esc_html( wp_kses( $post['title'], array() ) )
+ );
+
/** This action is documented in modules/widgets/top-posts.php */
do_action( 'jetpack_widget_top_posts_after_post', $post['post_id'] );
?>