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.
Использование
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(строка)
- Playlist output.
По умолчанию: '' - $attr(массив)
- An array of shortcode attributes.
- $instance(int)
- Unique numeric ID of this playlist shortcode instance.
Список изменений
С версии 3.9.0 | Введена. |
С версии 4.2.0 | The $instance parameter was added. |
Где вызывается хук
post_playlist
wp-includes/media.php 3061
$output = apply_filters( 'post_playlist', '', $attr, $instance );