WP_Widget_Media::has_content

Advertisement

Summery Summery

Whether the widget has content to show.

Syntax Syntax

WP_Widget_Media::has_content( array $instance )

Parameters Parameters

$instance

(Required) Widget instance props.

Return Return

(bool) Whether widget has content.

Source Source

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

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

Advertisement

Changelog Changelog

Changelog
Version Description
4.8.0 Introduced.

Advertisement

Leave a Reply