Add a filter and document it: playlist_styles. Allows users to roll their own playlist themes.

Props DrewAPicture for the docs.
See #26631.



git-svn-id: https://develop.svn.wordpress.org/trunk@27488 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-03-09 23:36:57 +00:00
parent 975cf5574a
commit c2cd0d6215
2 changed files with 30 additions and 6 deletions
+15 -1
View File
@@ -1123,7 +1123,21 @@ function wp_get_playlist( $attr, $type ) {
$orderby = 'none';
}
if ( ! in_array( $style, array( 'light', 'dark' ), true ) ) {
$playlist_styles = array(
'light' => _x( 'Light', 'light playlist theme' ),
'dark' => _x( 'Dark', 'dark playlist theme' )
);
/**
* Filter the available playlist styles.
*
* @since 3.9.0
*
* @param array $playlist_styles Array of playlist styles. Defaults are 'light' and 'dark'.
*/
$styles = apply_filters( 'playlist_styles', $playlist_styles );
if ( ! in_array( $style, array_keys( $styles ), true ) ) {
$style = 'light';
}