Media: Indicate if media is header video in media library.

This introduces a label to indicate if a piece of media is being used as a video header in the media library.
Props desrosj, Mista-Flo, mikeschroder.
Fixes #42929.


git-svn-id: https://develop.svn.wordpress.org/trunk@49205 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Anthony Burchell 2020-10-19 18:30:36 +00:00
parent 6c31412a70
commit 1dd1db6ec0

View File

@ -2270,6 +2270,13 @@ function _media_states( $post ) {
$media_states[] = __( 'Current Header Image' ); $media_states[] = __( 'Current Header Image' );
} }
} }
if ( get_theme_support( 'custom-header', 'video' ) && has_header_video() ) {
$mods = get_theme_mods();
if ( isset( $mods['header_video'] ) && $post->ID === $mods['header_video'] ) {
$media_states[] = __( 'Current Header Video' );
}
}
} }
if ( current_theme_supports( 'custom-background' ) ) { if ( current_theme_supports( 'custom-background' ) ) {