From 1dd1db6ec0d4e233a89fa6ea5ca8e468cab0f04e Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Mon, 19 Oct 2020 18:30:36 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/template.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 4f4d3e53f8..2e63b7e2dd 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -2270,6 +2270,13 @@ function _media_states( $post ) { $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' ) ) {