WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/27/2014 05:57:30 PM (6 years ago)
Author:
wonderboymusic
Message:

There is no more video-playlist shortcode. To use video, it is now [playlist type="video" ....]. Also deleting core playlist styles. The style attribute is still supported, defaulting to light. Our core style support was 4-5 CSS rules.

See #27552. Leaving open for comments and potential bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r27735 r27785  
    10731073 *
    10741074 * @param array  $attr Attributes of the shortcode.
    1075  * @param string $type Type of playlist. Accepts 'audio' and 'video'.
    10761075 * @return string Playlist output. Empty string if the passed type is unsupported.
    10771076 */
    1078 function wp_get_playlist( $attr, $type ) {
     1077function wp_playlist_shortcode( $attr ) {
    10791078    global $content_width;
    10801079    $post = get_post();
    1081 
    1082     if ( ! in_array( $type, array( 'audio', 'video' ) ) ) {
    1083         return '';
    1084     }
    10851080
    10861081    static $instance = 0;
     
    11071102     * @param string $type   Type of playlist to generate output for.
    11081103     */
    1109     $output = apply_filters( 'post_playlist', '', $attr, $type );
     1104    $output = apply_filters( 'post_playlist', '', $attr );
    11101105    if ( $output != '' ) {
    11111106        return $output;
     
    11231118
    11241119    extract( shortcode_atts( array(
     1120        'type'      => 'audio',
    11251121        'order'     => 'ASC',
    11261122        'orderby'   => 'menu_order ID',
     
    11291125        'exclude'   => '',
    11301126        'style'     => 'light',
    1131         'tracklist' => 'audio' === $type,
    1132         'tracknumbers' => 'audio' === $type,
     1127        'tracklist' => true,
     1128        'tracknumbers' => true,
    11331129        'images'    => true,
    11341130        'artists'   => true
     
    11381134    if ( 'RAND' == $order ) {
    11391135        $orderby = 'none';
    1140     }
    1141 
    1142     $playlist_styles = array(
    1143         'light' => _x( 'Light', 'playlist theme' ),
    1144         'dark'  => _x( 'Dark', 'playlist theme' )
    1145     );
    1146 
    1147     /**
    1148      * Filter the available playlist styles.
    1149      *
    1150      * @since 3.9.0
    1151      *
    1152      * @param array $playlist_styles Array of playlist styles. Defaults are 'light' and 'dark'.
    1153      */
    1154     $styles = apply_filters( 'playlist_styles', $playlist_styles );
    1155 
    1156     if ( ! in_array( $style, array_keys( $styles ), true ) ) {
    1157         $style = 'light';
    11581136    }
    11591137
     
    12031181    $theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width );
    12041182
    1205     $data = compact( 'type', 'style' );
     1183    $data = compact( 'type' );
    12061184
    12071185    // don't pass strings to JSON, will be truthy in JS
     
    13121290    return ob_get_clean();
    13131291}
    1314 
    1315 /**
    1316  * Playlist shortcode handler
    1317  *
    1318  * @since 3.9.0
    1319  *
    1320  * @param array $attr Parsed shortcode attributes.
    1321  * @return string The resolved playlist shortcode markup.
    1322  */
    1323 function wp_playlist_shortcode( $attr ) {
    1324     return wp_get_playlist( $attr, 'audio' );
    1325 }
    13261292add_shortcode( 'playlist', 'wp_playlist_shortcode' );
    1327 
    1328 /**
    1329  * Video playlist shortcode handler
    1330  *
    1331  * @since 3.9.0
    1332  *
    1333  * @param array $attr Parsed shortcode attributes.
    1334  * @return string The resolved video playlist shortcode markup.
    1335  */
    1336 function wp_video_playlist_shortcode( $attr ) {
    1337     return wp_get_playlist( $attr, 'video' );
    1338 }
    1339 add_shortcode( 'video-playlist', 'wp_video_playlist_shortcode' );
    13401293
    13411294/**
Note: See TracChangeset for help on using the changeset viewer.