wordpress / latest / classes / wp_widget_media / has_content.html

WP_Widget_Media::has_content( array $instance ): bool

Whether the widget has content to show.

Parameters

$instance array Required
Widget instance props.

Return

bool Whether widget has content.

Source

File: wp-includes/widgets/class-wp-widget-media.php. View all references

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

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
4.8.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_widget_media/has_content