WP_Widget_Media::has_content( array $instance ): bool

In this article

Whether the widget has content to show.

Parameters

$instancearrayrequired
Widget instance props.

Return

bool Whether widget has content.

Source

protected function has_content( $instance ) {
	return ( $instance['attachment_id'] && 'attachment' === get_post_type( $instance['attachment_id'] ) ) || $instance['url'];
}

Changelog

VersionDescription
4.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.