/**
* Displays the widget on the front-end.
*
* @since 4.8.0
*
* @see WP_Widget::widget()
*
* @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
* @param array $instance Saved setting from the database.
*/
public function widget( $args,
$instance ) { $instance =
wp_parse_args( $instance,
wp_list_pluck( $this->
get_instance_schema(), 'default'
) );
// Short-circuit if no media is selected.
if ( !
$this->
has_content( $instance ) ) { return;
} echo $args['before_widget'
];
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
$title =
apply_filters( 'widget_title',
$instance['title'
],
$instance,
$this->id_base
);