Make WordPress Core

Ticket #31071: 31071.5.diff

File 31071.5.diff, 3.0 KB (added by jnylen0, 8 years ago)

Fix the issue for 4.8

  • src/wp-includes/media.php

    diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
    index d3ba104..6253bd5 100644
    a b function wp_enqueue_media( $args = array() ) { 
    33243324        /**
    33253325         * Allows showing or hiding the "Create Audio Playlist" button in the media library.
    33263326         *
    3327          * By default (if this filter returns `null`), a query will be run to
    3328          * determine whether the media library contains any audio items.  This
    3329          * query is expensive for large media libraries, so it may be desirable for
    3330          * sites to override this behavior.
     3327         * By default, the "Create Audio Playlist" button will always be shown in
     3328         * the media library.  If this filter returns `null`, a query will be run
     3329         * to determine whether the media library contains any audio items.  This
     3330         * was the default behavior prior to version 4.8.0, but this query is
     3331         * expensive for large media libraries.
    33313332         *
    33323333         * @since 4.7.4
     3334         * @since 4.8.0 The filter's default value is `true` rather than `null`.
    33333335         *
    33343336         * @link https://core.trac.wordpress.org/ticket/31071
    33353337         *
    3336          * @param bool|null Whether to show the button, or `null` for default behavior.
     3338         * @param bool|null Whether to show the button, or `null` to decide based
     3339         *                  on whether any audio files exist in the media library.
    33373340         */
    3338         $show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', null );
     3341        $show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', true );
    33393342        if ( null === $show_audio_playlist ) {
    33403343                $show_audio_playlist = $wpdb->get_var( "
    33413344                        SELECT ID
    function wp_enqueue_media( $args = array() ) { 
    33493352        /**
    33503353         * Allows showing or hiding the "Create Video Playlist" button in the media library.
    33513354         *
    3352          * By default (if this filter returns `null`), a query will be run to
    3353          * determine whether the media library contains any video items.  This
    3354          * query is expensive for large media libraries, so it may be desirable for
    3355          * sites to override this behavior.
     3355         * By default, the "Create Video Playlist" button will always be shown in
     3356         * the media library.  If this filter returns `null`, a query will be run
     3357         * to determine whether the media library contains any video items.  This
     3358         * was the default behavior prior to version 4.8.0, but this query is
     3359         * expensive for large media libraries.
    33563360         *
    33573361         * @since 4.7.4
     3362         * @since 4.8.0 The filter's default value is `true` rather than `null`.
    33583363         *
    33593364         * @link https://core.trac.wordpress.org/ticket/31071
    33603365         *
    3361          * @param bool|null Whether to show the button, or `null` for default behavior.
     3366         * @param bool|null Whether to show the button, or `null` to decide based
     3367         *                  on whether any video files exist in the media library.
    33623368         */
    3363         $show_video_playlist = apply_filters( 'media_library_show_video_playlist', null );
     3369        $show_video_playlist = apply_filters( 'media_library_show_video_playlist', true );
    33643370        if ( null === $show_video_playlist ) {
    33653371                $show_video_playlist = $wpdb->get_var( "
    33663372                        SELECT ID