WordPress at a glance
function is not described

WP_Widget_Media_Gallery::has_content() protected WP 4.9.0

Whether the widget has content to show.

{} It's a method of the class: WP_Widget_Media_Gallery{}

No Hooks.

Return

true|false. Whether widget has content.

Usage

// protected - for code of main (parent) or child class
$result = $this->has_content( $instance );
$instance(array) (required)
Widget instance props.

Changelog

Since 4.9.0 Introduced.

Code of WP_Widget_Media_Gallery::has_content() WP 5.7.2

<?php
protected function has_content( $instance ) {
	if ( ! empty( $instance['ids'] ) ) {
		$attachments = wp_parse_id_list( $instance['ids'] );
		foreach ( $attachments as $attachment ) {
			if ( 'attachment' !== get_post_type( $attachment ) ) {
				return false;
			}
		}
		return true;
	}
	return false;
}