has_header_video example

// Display "Header Image" if the image was ever used as a header image.             if ( ! empty( $meta_header ) && $meta_header === $stylesheet && wp_get_attachment_url( $post->ID ) !== $header_image ) {
                $media_states[] = __( 'Header Image' );
            }

            // Display "Current Header Image" if the image is currently the header image.             if ( $header_image && wp_get_attachment_url( $post->ID ) === $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' ) ) {
        $meta_background = get_post_meta( $post->ID, '_wp_attachment_is_custom_background', true );

        if ( ! empty( $meta_background ) && $meta_background === $stylesheet ) {
            
return apply_filters( 'header_video_settings', $settings );
}

/** * Checks whether a custom header is set or not. * * @since 4.7.0 * * @return bool True if a custom header is set. False if not. */
function has_custom_header() {
    if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {
        return true;
    }

    return false;
}

/** * Checks whether the custom header video is eligible to show on the current page. * * @since 4.7.0 * * @return bool True if the custom header video should be shown. False if not. */
Home | Imprint | This part of the site doesn't use cookies.