diff --git src/wp-includes/theme.php src/wp-includes/theme.php
index baad12f..efd6692 100644
|
|
|
function get_header_video_settings() { |
| 1400 | 1400 | * @return bool True if a custom header is set. False if not. |
| 1401 | 1401 | */ |
| 1402 | 1402 | function has_custom_header() { |
| 1403 | | if ( has_header_image() || ( is_front_page() && has_header_video() ) ) { |
| | 1403 | if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) { |
| 1404 | 1404 | return true; |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| … |
… |
function has_custom_header() { |
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | /** |
| | 1411 | * Checks whether the custom header video is eligible to show on the current page. |
| | 1412 | * |
| | 1413 | * @since 4.7.0 |
| | 1414 | * |
| | 1415 | * @return bool True if the custom header video should be shown. False if not. |
| | 1416 | */ |
| | 1417 | function is_header_video_active() { |
| | 1418 | if ( ! get_theme_support( 'custom-header', 'video' ) ) { |
| | 1419 | return false; |
| | 1420 | } |
| | 1421 | |
| | 1422 | /** |
| | 1423 | * Modify whether the custom header video is eleigble to show on the current page. |
| | 1424 | * |
| | 1425 | * @since 4.7.0 |
| | 1426 | * |
| | 1427 | * @param bool $show_video Whether the custom header video should be shown. Defaults to true on the site's front page, false eleswhere. |
| | 1428 | */ |
| | 1429 | return apply_filters( 'is_header_video_active', is_front_page() ); |
| | 1430 | } |
| | 1431 | |
| | 1432 | /** |
| 1411 | 1433 | * Retrieve the markup for a custom header. |
| 1412 | 1434 | * |
| 1413 | 1435 | * @since 4.7.0 |
| … |
… |
function the_custom_header_markup() { |
| 1436 | 1458 | } |
| 1437 | 1459 | echo $custom_header; |
| 1438 | 1460 | |
| 1439 | | if ( has_header_video() && is_front_page() ) { |
| | 1461 | if ( has_header_video() && is_header_video_active() ) { |
| 1440 | 1462 | wp_enqueue_script( 'wp-custom-header' ); |
| 1441 | 1463 | wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() ); |
| 1442 | 1464 | } |