wp-includes/blocks/cover.php:18Renders the core/cover block on server.
$attributesarray$contentstringstringfunction render_block_core_cover( $attributes, $content ) { // Handle embed video background. if ( isset( $attributes['backgroundType'] ) && 'embed-video' === $attributes['backgroundType'] && isset( $attributes['url'] ) && ! empty( $attributes['url'] ) && is_string( $attributes['url'] ) ) { $url = $attributes['url']; // Use WordPress's native oEmbed processing (includes caching). $oembed_html = wp_oembed_get( $url ); if ( $oembed_html ) { // Extract iframe src from the oEmbed HTML. preg_match( '/src=["\']([^"\']+)["\']/', $oembed_html, $src_matches ); if ( ! empty( $src_matches[1] ) ) { $iframe_src = $src_matches[1]; // Detect provider from iframe src URL. $lower_src = strtolower( $iframe_src ); $provider = null; if ( str_contains( $lower_src, 'youtube.com' ) || str_contains( $lower_src, 'youtu.be' ) ) { $provider = 'youtube'; } elseif ( str_contains( $lower_src, 'vimeo.com' ) ) { $provider = 'vimeo'; } elseif ( str_contains( $lower_src, 'videopress.com' ) ) { $provider = 'videopress'; } elseif ( str_contains( $lower_src, 'wordpress.tv' ) ) { $provider = 'wordpress-tv'; } // Modify iframe src to add background video parameters based on provider. $parsed_url = wp_parse_url( $iframe_src ); if ( $parsed_url && isset( $parsed_url['host'] ) ) { // Parse existing query parameters. $query_params = array(); if ( isset( $parsed_url['query'] ) ) { parse_str( $parsed_url['query'], $query_params ); } // Add background video parameters based on provider. if ( 'youtube' === $provider ) { $query_params['autoplay'] = '1'; $query_params['mute'] = '1'; $query_params['loop'] = '1'; $query_params['controls'] = '0'; $query_params['modestbranding'] = '1'; $query_params['playsinline'] = '1'; // For loop to work, we need the playlist parameter. $path = $parsed_url['path'] ?? ''; $path_segments = explode( '/', $path ); $video_id = end( $path_segments ); if ( $video_id ) { $query_params['playlist'] = $video_id; } } elseif ( 'vimeo' === $provider ) { $query_params['autoplay'] = '1'; $query_params['muted'] = '1'; $query_params['loop'] = '1'; $query_params['background'] = '1'; $query_params['controls'] = '0'; $query_params['transparent'] = '0'; } elseif ( 'videopress' === $provider || 'wordpress-tv' === $provider ) { $query_params['autoplay'] = '1'; $query_params['loop'] = '1'; $query_params['muted'] = '1'; } // Rebuild the URL with new parameters. $iframe_src = $parsed_url['scheme'] . '://' . $parsed_url['host']; if ( isset( $parsed_url['path'] ) ) { $iframe_src .= $parsed_url['path']; } if ( ! empty( $query_params ) ) { $iframe_src .= '?' . http_build_query( $query_params ); }Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/blocks/cover.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.