Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: media_library_show_audio_playlist

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3493       *
3494       * @since 4.7.4
3495       * @since 4.8.0 The filter's default value is `true` rather than `null`.
3496       *
3497       * @link https://core.trac.wordpress.org/ticket/31071
3498       *
3499       * @param bool|null Whether to show the button, or `null` to decide based
3500       *                  on whether any audio files exist in the media library.
3501       */
3502      $show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', true );
3503      if ( null === $show_audio_playlist ) {
3504           $show_audio_playlist = $wpdb->get_var(
3505                "
3506                SELECT ID
3507                FROM $wpdb->posts
3508                WHERE post_type = 'attachment'
3509                AND post_mime_type LIKE 'audio%'
3510                LIMIT 1
3511           "