media_library_show_video_playlist

Allows showing or hiding the "Create Video Playlist" button in the media library.

Description

apply_filters( 'media_library_show_video_playlist', (null) $null ); 

By default (if this filter returns null), a query will be run to determine whether the media library contains any video items. This query is expensive for large media libraries, so it may be desirable for sites to override this behavior.

Parameters (1)

0. $null (null) => null
Whether to show the button, or null for default behavior.

Usage

To run the hook, copy the example below.
  1. $null = apply_filters( 'media_library_show_video_playlist', $null ); 
  2.  
  3. if ( !empty( $null ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the media_library_show_video_playlist callback 
  2. function filter_media_library_show_video_playlist( $null ) { 
  3. // make filter magic happen here... 
  4. return $null
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'media_library_show_video_playlist', 'filter_media_library_show_video_playlist', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'media_library_show_video_playlist', 'filter_media_library_show_video_playlist', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/media.php  
  1. $show_video_playlist = apply_filters( 'media_library_show_video_playlist', null );