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/cover.php +10 -3 23.1.1 → trunk View file →
@@ -133,10 +133,17 @@
133 133 if ( 'image' !== $attributes['backgroundType'] || false === $attributes['useFeaturedImage'] ) {
134 134 return $content;
135 135 }
136 136
137 - $object_position = isset( $attributes['focalPoint'] )
138 - ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%'
137 + $cover_focal_point = $attributes['focalPoint'] ?? null;
138 + $focal_point_x = null;
139 + $focal_point_y = null;
140 + if ( is_array( $cover_focal_point ) ) {
141 + $focal_point_x = isset( $cover_focal_point['x'] ) && is_numeric( $cover_focal_point['x'] ) ? $cover_focal_point['x'] : null;
142 + $focal_point_y = isset( $cover_focal_point['y'] ) && is_numeric( $cover_focal_point['y'] ) ? $cover_focal_point['y'] : null;
143 + }
144 + $object_position = null !== $focal_point_x && null !== $focal_point_y
145 + ? round( $focal_point_x * 100 ) . '% ' . round( $focal_point_y * 100 ) . '%'
139 146 : null;
140 147
141 148 if ( ! ( $attributes['hasParallax'] || $attributes['isRepeated'] ) ) {
142 149 $attr = array(
@@ -153,9 +160,9 @@
153 160 } else {
154 161 if ( in_the_loop() ) {
155 162 update_post_thumbnail_cache();
156 163 }
157 - $current_featured_image = get_the_post_thumbnail_url( null, $attributes['sizeSlug'] ?? null );
164 + $current_featured_image = get_the_post_thumbnail_url( null, $attributes['sizeSlug'] ?? 'full' );
158 165 if ( ! $current_featured_image ) {
159 166 return $content;
160 167 }
161 168