diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/widgets/class-wp-widget-recent-comments.php --- a/wp/wp-includes/widgets/class-wp-widget-recent-comments.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-recent-comments.php Mon Oct 14 18:28:13 2019 +0200 @@ -23,8 +23,8 @@ */ public function __construct() { $widget_ops = array( - 'classname' => 'widget_recent_comments', - 'description' => __( 'Your site’s most recent comments.' ), + 'classname' => 'widget_recent_comments', + 'description' => __( 'Your site’s most recent comments.' ), 'customize_selective_refresh' => true, ); parent::__construct( 'recent-comments', __( 'Recent Comments' ), $widget_ops ); @@ -35,7 +35,7 @@ } } - /** + /** * Outputs the default styles for the Recent Comments widget. * * @since 2.8.0 @@ -50,8 +50,9 @@ * @param string $id_base The widget ID. */ if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876 - || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) + || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) { return; + } ?> id; + } $output = ''; @@ -78,8 +80,9 @@ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; - if ( ! $number ) + if ( ! $number ) { $number = 5; + } /** * Filters the arguments for the Recent Comments widget. @@ -92,11 +95,17 @@ * @param array $comment_args An array of arguments used to retrieve the recent comments. * @param array $instance Array of settings for the current widget. */ - $comments = get_comments( apply_filters( 'widget_comments_args', array( - 'number' => $number, - 'status' => 'approve', - 'post_status' => 'publish' - ), $instance ) ); + $comments = get_comments( + apply_filters( + 'widget_comments_args', + array( + 'number' => $number, + 'status' => 'approve', + 'post_status' => 'publish', + ), + $instance + ) + ); $output .= $args['before_widget']; if ( $title ) { @@ -112,7 +121,8 @@ foreach ( (array) $comments as $comment ) { $output .= '
  • '; /* translators: comments widget: 1: comment author, 2: post link */ - $output .= sprintf( _x( '%1$s on %2$s', 'widgets' ), + $output .= sprintf( + _x( '%1$s on %2$s', 'widgets' ), '' . get_comment_author_link( $comment ) . '', '' . get_the_title( $comment->comment_post_ID ) . '' ); @@ -136,8 +146,8 @@ * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { - $instance = $old_instance; - $instance['title'] = sanitize_text_field( $new_instance['title'] ); + $instance = $old_instance; + $instance['title'] = sanitize_text_field( $new_instance['title'] ); $instance['number'] = absint( $new_instance['number'] ); return $instance; } @@ -150,7 +160,7 @@ * @param array $instance Current settings. */ public function form( $instance ) { - $title = isset( $instance['title'] ) ? $instance['title'] : ''; + $title = isset( $instance['title'] ) ? $instance['title'] : ''; $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; ?>