芝麻web文件管理V1.00
编辑当前文件:/www/wwwroot/ndrc25-ismael-laouar.stagiairesifa.fr/wp-includes/blocks/video.php
0 && $metadata['height'] > 0 ) ) { return $content; } // Locate the VIDEO tag to add the dimensions. $p = new WP_HTML_Tag_Processor( $content ); if ( ! $p->next_tag( array( 'tag_name' => 'VIDEO' ) ) ) { return $content; } $p->set_attribute( 'width', (string) $metadata['width'] ); $p->set_attribute( 'height', (string) $metadata['height'] ); /* * The aspect-ratio style is needed due to an issue with the CSS spec:
. * Note that a style rule using attr() like the following cannot currently be used: * * .wp-block-video video[width][height] { * aspect-ratio: attr(width type(
)) / attr(height type(
)); * } * * This is because this attr() is yet only implemented in Chromium:
. */ $style = $p->get_attribute( 'style' ); if ( ! is_string( $style ) ) { $style = ''; } $aspect_ratio_style = sprintf( 'aspect-ratio: %d / %d;', $metadata['width'], $metadata['height'] ); $p->set_attribute( 'style', $aspect_ratio_style . $style ); return $p->get_updated_html(); } /** * Registers the `core/video` block on server. * * @since 6.9.0 */ function register_block_core_video(): void { register_block_type_from_metadata( __DIR__ . '/video', array( 'render_callback' => 'render_block_core_video', ) ); } add_action( 'init', 'register_block_core_video' );