PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-library/media-text.php +11 -2 23.5.2 → trunk View file →
@@ -30,10 +30,19 @@
30 30 }
31 31
32 32 $has_media_on_right = 'right' === ( $attributes['mediaPosition'] ?? null );
33 33 $image_fill = (bool) ( $attributes['imageFill'] ?? false );
34 - $focal_point = isset( $attributes['focalPoint'] ) ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%' : '50% 50%';
35 - $unique_id = 'wp-block-media-text__media-' . wp_unique_id();
34 + $focal_point_attr = $attributes['focalPoint'] ?? null;
35 + $focal_point_x = null;
36 + $focal_point_y = null;
37 + if ( is_array( $focal_point_attr ) ) {
38 + $focal_point_x = isset( $focal_point_attr['x'] ) && is_numeric( $focal_point_attr['x'] ) ? $focal_point_attr['x'] : null;
39 + $focal_point_y = isset( $focal_point_attr['y'] ) && is_numeric( $focal_point_attr['y'] ) ? $focal_point_attr['y'] : null;
40 + }
41 + $focal_point = null !== $focal_point_x && null !== $focal_point_y
42 + ? round( $focal_point_x * 100 ) . '% ' . round( $focal_point_y * 100 ) . '%'
43 + : '50% 50%';
44 + $unique_id = 'wp-block-media-text__media-' . wp_unique_id();
36 45
37 46 $block_tag_processor = new WP_HTML_Tag_Processor( $content );
38 47 $block_query = array(
39 48 'tag_name' => 'div',