wp_playlist_scripts
Action HookDescription
Prints and enqueues playlist scripts, styles, and JavaScript templates.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Action |
Line Number | 3241 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$type
|
Type of playlist. Possible values are 'audio' or 'video'. |
string
|
$style
|
The 'theme' for the playlist. Core provides 'light' and 'dark'. |
Usage Examples
Basic Usage
<?php
// Hook into wp_playlist_scripts
add_action('wp_playlist_scripts', 'my_custom_function', 10, 2);
function my_custom_function($type, $style) {
// Your custom code here
}
Source Code Context
wp-includes/media.php:3241
- How this hook is used in WordPress core
<?php
3236 * @since 3.9.0
3237 *
3238 * @param string $type Type of playlist. Possible values are 'audio' or 'video'.
3239 * @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'.
3240 */
3241 do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );
3242 }
3243 ?>
3244 <div class="wp-playlist wp-<?php echo $safe_type; ?>-playlist wp-playlist-<?php echo $safe_style; ?>">
3245 <?php if ( 'audio' === $atts['type'] ) : ?>
3246 <div class="wp-playlist-current-item"></div>
PHP Documentation
<?php
/**
* Prints and enqueues playlist scripts, styles, and JavaScript templates.
*
* @since 3.9.0
*
* @param string $type Type of playlist. Possible values are 'audio' or 'video'.
* @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.