Make WordPress Core

Ticket #26631: 26631.14.diff

File 26631.14.diff, 1.6 KB (added by wonderboymusic, 10 years ago)
  • src/wp-includes/media-template.php

     
    422422                        <input type="checkbox" data-setting="_orderbyRandom" />
    423423                </label>
    424424
     425                <?php
     426                $playlist_styles = array(
     427                        'light' => __( 'Light' ),
     428                        'dark'  => __( 'Dark' )
     429                );
     430
     431                $styles = apply_filters( 'playlist_styles', $playlist_styles );
     432
     433                if ( ! empty( $styles ) ): ?>
    425434                <label class="setting">
    426435                        <span><?php _e( 'Style' ); ?></span>
    427436                        <select class="style" data-setting="style">
    428                                 <option value="light">
    429                                         <?php esc_attr_e( 'Light' ); ?>
     437                                <?php foreach ( $styles as $slug => $label ): ?>
     438                                <option value="<?php echo esc_attr( $slug ) ?>">
     439                                        <?php echo $label ?>
    430440                                </option>
    431                                 <option value="dark">
    432                                         <?php esc_attr_e( 'Dark' ); ?>
    433                                 </option>
     441                                <?php endforeach ?>
    434442                        </select>
    435443                </label>
     444                <?php endif; ?>
    436445
    437446                <#
    438447                        var playlist = 'playlist-edit' === data.controller.id, emptyModel = _.isEmpty(data.model);
  • src/wp-includes/media.php

     
    11231123                $orderby = 'none';
    11241124        }
    11251125
    1126         if ( ! in_array( $style, array( 'light', 'dark' ), true ) ) {
     1126        $playlist_styles = array(
     1127                'light' => __( 'Light' ),
     1128                'dark'  => __( 'Dark' )
     1129        );
     1130        $styles = apply_filters( 'playlist_styles', $playlist_styles );
     1131
     1132        if ( ! in_array( $style, array_keys( $styles ), true ) ) {
    11271133                $style = 'light';
    11281134        }
    11291135