wp_underscore_playlist_templates()

In this article

Outputs the templates used by playlists.

Source

}

$itemtag    = tag_escape( $atts['itemtag'] );
$captiontag = tag_escape( $atts['captiontag'] );
$icontag    = tag_escape( $atts['icontag'] );
$valid_tags = wp_kses_allowed_html( 'post' );
if ( ! isset( $valid_tags[ $itemtag ] ) ) {
	$itemtag = 'dl';
}
if ( ! isset( $valid_tags[ $captiontag ] ) ) {
	$captiontag = 'dd';
}
if ( ! isset( $valid_tags[ $icontag ] ) ) {
	$icontag = 'dt';
}

$columns   = (int) $atts['columns'];
$itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100;
$float     = is_rtl() ? 'right' : 'left';

$selector = "gallery-{$instance}";

$gallery_style = '';

/**
 * Filters whether to print default gallery styles.
 *
 * @since 3.1.0
 *
 * @param bool $print Whether to print default gallery styles.
 *                    Defaults to false if the theme supports HTML5 galleries.
 *                    Otherwise, defaults to true.
 */
if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
	$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';

	$gallery_style = "
	<style{$type_attr}>
		#{$selector} {
			margin: auto;
		}
		#{$selector} .gallery-item {
			float: {$float};
			margin-top: 10px;
			text-align: center;
			width: {$itemwidth}%;
		}
		#{$selector} img {

Changelog

VersionDescription
3.9.0Introduced.

User Contributed Notes

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