Ticket #38738: 38738.diff
| File 38738.diff, 1.5 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/theme.php
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 … … 1408 1408 } 1409 1409 1410 1410 /** 1411 * Checks whether the custom header video is eligible to show on the current page. 1412 * 1413 * @since 1.0.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 $video_active_cb = get_theme_support( 'custom-header', 'video-active-callback' ); 1419 if ( empty( $video_active_cb ) || ! is_callable( $video_active_cb ) ) { 1420 return true; 1421 } 1422 1423 return call_user_func( $video_active_cb ); 1424 } 1425 1426 /** 1411 1427 * Retrieve the markup for a custom header. 1412 1428 * 1413 1429 * @since 4.7.0 … … 1436 1452 } 1437 1453 echo $custom_header; 1438 1454 1439 if ( has_header_video() && is_ front_page() ) {1455 if ( has_header_video() && is_header_video_active() ) { 1440 1456 wp_enqueue_script( 'wp-custom-header' ); 1441 1457 wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() ); 1442 1458 } … … 2048 2064 'admin-head-callback' => '', 2049 2065 'admin-preview-callback' => '', 2050 2066 'video' => false, 2067 'video-active-callback' => 'is_front_page', 2051 2068 ); 2052 2069 2053 2070 $jit = isset( $args[0]['__jit'] );