@@ -1290,12 +1290,13 @@ public static function enqueue_assets() {
12901290 * @return string $html Filtered markup.
12911291 */
12921292 public static function conditionally_output_header ( $ html , $ header , $ atts ) {
1293+ unset( $ header );
12931294 if ( ! is_header_video_active () ) {
12941295 return $ html ;
12951296 };
12961297
12971298 if ( ! has_header_video () ) {
1298- return self :: output_header_image ( $ atts );
1299+ return AMP_HTML_Utils:: build_tag ( ' amp-img ' , $ atts );
12991300 }
13001301
13011302 return self ::output_header_video ( $ atts );
@@ -1304,13 +1305,10 @@ public static function conditionally_output_header( $html, $header, $atts ) {
13041305 /**
13051306 * Replace the header image markup with a header video.
13061307 *
1307- * This is JS-driven in Core themes like Twenty Sixteen and Twenty Seventeen.
1308- * So in order for the header video to display,
1309- * this replaces the markup of the header image.
1310- *
13111308 * @since 1.0
13121309 * @link https://github.com/WordPress/wordpress-develop/blob/d002fde80e5e3a083e5f950313163f566561517f/src/wp-includes/js/wp-custom-header.js#L54
13131310 * @link https://github.com/WordPress/wordpress-develop/blob/d002fde80e5e3a083e5f950313163f566561517f/src/wp-includes/js/wp-custom-header.js#L78
1311+ *
13141312 * @param array $atts The header tag attributes array.
13151313 * @return string $html Filtered markup.
13161314 */
@@ -1331,7 +1329,7 @@ public static function output_header_video( $atts ) {
13311329 );
13321330
13331331 // Create image banner to stay behind the video.
1334- $ image_header = self :: output_header_image ( $ atts );
1332+ $ image_header = AMP_HTML_Utils:: build_tag ( ' amp-img ' , $ atts );
13351333
13361334 // If the video URL is for YouTube, return an <amp-youtube> element.
13371335 if ( isset ( $ parsed_url ['host ' ], $ query ['v ' ] ) && ( false !== strpos ( $ parsed_url ['host ' ], 'youtube ' ) ) ) {
@@ -1361,24 +1359,4 @@ public static function output_header_video( $atts ) {
13611359
13621360 return $ image_header . $ video_header ;
13631361 }
1364-
1365- /**
1366- * Replace the header image markup with a header image.
1367- *
1368- * This is JS-driven in Core themes like Twenty Sixteen and Twenty Seventeen.
1369- * So in order for the header video to display,
1370- * this replaces the markup of the header image.
1371- *
1372- * @since 1.0
1373- * @link https://github.com/WordPress/wordpress-develop/blob/d002fde80e5e3a083e5f950313163f566561517f/src/wp-includes/js/wp-custom-header.js#L54
1374- * @param array $atts The image tag attributes.
1375- * @return string $html Filtered markup.
1376- */
1377- public static function output_header_image ( $ atts ) {
1378-
1379- $ place_holder = AMP_HTML_Utils::build_tag ( 'amp-img ' , $ atts );
1380-
1381- return $ place_holder ;
1382-
1383- }
13841362}
0 commit comments