@@ 343-348 (lines=6) @@ | ||
340 | * If it does not have an ID, let `from_html` parse that content later, |
|
341 | * and extract an image if it has size parameters. |
|
342 | */ |
|
343 | if ( |
|
344 | 'core/image' === $block['blockName'] |
|
345 | && ! empty( $block['attrs']['id'] ) |
|
346 | ) { |
|
347 | $images[] = self::get_attachment_data( $block['attrs']['id'], $post_url, $width, $height ); |
|
348 | } |
|
349 | ||
350 | /** |
|
351 | * Parse content from Core Gallery blocks. |
|
@@ 354-361 (lines=8) @@ | ||
351 | * Parse content from Core Gallery blocks. |
|
352 | * Gallery blocks include the ID of each one of the images in the gallery. |
|
353 | */ |
|
354 | if ( |
|
355 | 'core/gallery' === $block['blockName'] |
|
356 | && ! empty( $block['attrs']['ids'] ) |
|
357 | ) { |
|
358 | foreach ( $block['attrs']['ids'] as $img_id ) { |
|
359 | $images[] = self::get_attachment_data( $img_id, $post_url, $width, $height ); |
|
360 | } |
|
361 | } |
|
362 | } |
|
363 | ||
364 | return $images; |