| @@ -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 | |