wp_playlist_scripts() WordPress Function

The wp_playlist_scripts() function loads the necessary scripts for the playlists feature in WordPress. This function is called by the wp_enqueue_scripts() function.

wp_playlist_scripts( string $type ) #

Outputs and enqueue default scripts and styles for playlists.


Parameters

$type

(string)(Required)Type of playlist. Accepts 'audio' or 'video'.


Top ↑

Source

File: wp-includes/media.php

function wp_playlist_scripts( $type ) {
	wp_enqueue_style( 'wp-mediaelement' );
	wp_enqueue_script( 'wp-playlist' );
	?>
<!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]-->
	<?php
	add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 );
	add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 );
}


Top ↑

Changelog

Changelog
VersionDescription
3.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More