Title: get_header_video_settings
Published: December 7, 2016
Last modified: August 20, 2026

---

# get_header_video_settings(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#wp--skip-link--target)

Retrieves header video settings.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#return)󠁿

 array

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#source)󠁿

    ```php
    function get_header_video_settings() {
    	$header     = get_custom_header();
    	$video_url  = get_header_video_url();
    	$video_type = wp_check_filetype( $video_url, wp_get_mime_types() );

    	$settings = array(
    		'mimeType'  => '',
    		'posterUrl' => get_header_image(),
    		'videoUrl'  => $video_url,
    		'width'     => absint( $header->width ),
    		'height'    => absint( $header->height ),
    		'minWidth'  => 900,
    		'minHeight' => 500,
    		'l10n'      => array(
    			'pause'      => __( 'Pause' ),
    			'play'       => __( 'Play' ),
    			'pauseSpeak' => __( 'Video is paused.' ),
    			'playSpeak'  => __( 'Video is playing.' ),
    		),
    	);

    	if ( preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video_url ) ) {
    		$settings['mimeType'] = 'video/x-youtube';
    	} elseif ( ! empty( $video_type['type'] ) ) {
    		$settings['mimeType'] = $video_type['type'];
    	}

    	/**
    	 * Filters header video settings.
    	 *
    	 * @since 4.7.0
    	 *
    	 * @param array $settings An array of header video settings.
    	 */
    	return apply_filters( 'header_video_settings', $settings );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/theme.php#L1708)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/theme.php#L1708-L1743)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#hooks)󠁿

 [apply_filters( ‘header_video_settings’, array $settings )](https://developer.wordpress.org/reference/hooks/header_video_settings/)

Filters header video settings.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#related)󠁿

| Uses | Description | 
| [get_header_video_url()](https://developer.wordpress.org/reference/functions/get_header_video_url/)`wp-includes/theme.php` |

Retrieves header video URL for custom header.

  | 
| [get_custom_header()](https://developer.wordpress.org/reference/functions/get_custom_header/)`wp-includes/theme.php` |

Gets the header image data.

  | 
| [get_header_image()](https://developer.wordpress.org/reference/functions/get_header_image/)`wp-includes/theme.php` |

Retrieves header image for custom header.

  | 
| [wp_check_filetype()](https://developer.wordpress.org/reference/functions/wp_check_filetype/)`wp-includes/functions.php` |

Retrieves the file type from the file name.

  | 
| [wp_get_mime_types()](https://developer.wordpress.org/reference/functions/wp_get_mime_types/)`wp-includes/functions.php` |

Retrieves the list of mime types and file extensions.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [absint()](https://developer.wordpress.org/reference/functions/absint/)`wp-includes/load.php` |

Converts a value to non-negative integer.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 3 more](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#)

| Used by | Description | 
| [WP_Customize_Manager::export_header_video_settings()](https://developer.wordpress.org/reference/classes/wp_customize_manager/export_header_video_settings/)`wp-includes/class-wp-customize-manager.php` |

Exports header video settings to facilitate selective refresh.

  | 
| [the_custom_header_markup()](https://developer.wordpress.org/reference/functions/the_custom_header_markup/)`wp-includes/theme.php` |

Prints the markup for a custom header.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_header_video_settings/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_header_video_settings%2F)
before being able to contribute a note or feedback.