post_playlist
Filters the playlist output.
Returning a non-empty value from the filter will short-circuit generation of the default playlist output, returning the passed value instead.
Usage
add_filter( 'post_playlist', 'wp_kama_post_playlist_filter', 10, 3 ); /** * Function for `post_playlist` filter-hook. * * @param string $output Playlist output. * @param array $attr An array of shortcode attributes. * @param int $instance Unique numeric ID of this playlist shortcode instance. * * @return string */ function wp_kama_post_playlist_filter( $output, $attr, $instance ){ // filter... return $output; }
- $output(string)
- Playlist output.
Default: '' - $attr(array)
- An array of shortcode attributes.
- $instance(int)
- Unique numeric ID of this playlist shortcode instance.
Changelog
Since 3.9.0 | Introduced. |
Since 4.2.0 | The $instance parameter was added. |
Where the hook is called
post_playlist
wp-includes/media.php 2945
$output = apply_filters( 'post_playlist', '', $attr, $instance );