wp_maybe_generate_attachment_metadata( WP_Post $attachment )

In this article

Maybe attempts to generate attachment metadata, if missing.

Parameters

$attachmentWP_Postrequired
Attachment object.

Source

					$shortcode_attrs,
					array(
						'src' => array_values( array_unique( $srcs ) ),
					)
				);
			}
		}
	}
}

if ( has_block( 'gallery', $post->post_content ) ) {
	$post_blocks = parse_blocks( $post->post_content );

	while ( $block = array_shift( $post_blocks ) ) {
		$has_inner_blocks = ! empty( $block['innerBlocks'] );

		// Skip blocks with no blockName and no innerHTML.
		if ( ! $block['blockName'] ) {
			continue;
		}

Changelog

VersionDescription
3.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.