WP_Widget_Media_Gallery::render_media

Advertisement

Summery Summery

Render the media on the frontend.

Syntax Syntax

WP_Widget_Media_Gallery::render_media( array $instance )

Parameters Parameters

$instance

(array) (Required) Widget instance props.

Source Source

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

	public function render_media( $instance ) {
		$instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );

		$shortcode_atts = array_merge(
			$instance,
			array(
				'link' => $instance['link_type'],
			)
		);

		// @codeCoverageIgnoreStart
		if ( $instance['orderby_random'] ) {
			$shortcode_atts['orderby'] = 'rand';
		}

		// @codeCoverageIgnoreEnd
		echo gallery_shortcode( $shortcode_atts );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.