is_header_video_active

Checks whether the custom header video is eligible to show on the current page.

Description

is_header_video_active(); 

Usage

  1. if ( !function_exists( 'is_header_video_active' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = is_header_video_active(); 
  7.  

Defined (1)

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

/wp-includes/theme.php  
  1. function is_header_video_active() { 
  2. if ( ! get_theme_support( 'custom-header', 'video' ) ) { 
  3. return false; 
  4.  
  5. $video_active_cb = get_theme_support( 'custom-header', 'video-active-callback' ); 
  6.  
  7. if ( empty( $video_active_cb ) || ! is_callable( $video_active_cb ) ) { 
  8. $show_video = true; 
  9. } else { 
  10. $show_video = call_user_func( $video_active_cb ); 
  11.  
  12. /** 
  13. * Modify whether the custom header video is eligible to show on the current page. 
  14. * @since 4.7.0 
  15. * @param bool $show_video Whether the custom header video should be shown. Returns the value 
  16. * of the theme setting for the `custom-header`'s `video-active-callback`. 
  17. * If no callback is set, the default value is that of `is_front_page()`. 
  18. */ 
  19. return apply_filters( 'is_header_video_active', $show_video );