get_header_video_settings

Retrieve header video settings.

Description

(array) get_header_video_settings(); 

Returns (array)


Usage

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

Defined (1)

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

/wp-includes/theme.php  
  1. function get_header_video_settings() { 
  2. $header = get_custom_header(); 
  3. $video_url = get_header_video_url(); 
  4. $video_type = wp_check_filetype( $video_url, wp_get_mime_types() ); 
  5.  
  6. $settings = array( 
  7. 'mimeType' => '',  
  8. 'posterUrl' => get_header_image(),  
  9. 'videoUrl' => $video_url,  
  10. 'width' => absint( $header->width ),  
  11. 'height' => absint( $header->height ),  
  12. 'minWidth' => 900,  
  13. 'minHeight' => 500,  
  14. 'l10n' => array( 
  15. 'pause' => __( 'Pause' ),  
  16. 'play' => __( 'Play' ),  
  17. 'pauseSpeak' => __( 'Video is paused.'),  
  18. 'playSpeak' => __( 'Video is playing.'),  
  19. ),  
  20. ); 
  21.  
  22. if ( preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video_url ) ) { 
  23. $settings['mimeType'] = 'video/x-youtube'; 
  24. } elseif ( ! empty( $video_type['type'] ) ) { 
  25. $settings['mimeType'] = $video_type['type']; 
  26.  
  27. return apply_filters( 'header_video_settings', $settings );