wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



block_core_gallery_render_context › WordPress Function

Seit7.0.0
Veraltetn/v
block_core_gallery_render_context ( $context, $parsed_block )
Parameter: (2)
  • (array) $context Default context.
    Erforderlich: Ja
  • (array) $parsed_block Block being rendered, filtered by render_block_data.
    Erforderlich: Ja
Gibt zurück:
  • (array) Filtered context.
Definiert in:
Codex:

Adds a unique ID to the gallery block context.



Quellcode

function block_core_gallery_render_context( $context, $parsed_block ) {
	if ( 'core/gallery' === $parsed_block['blockName'] ) {
		$context['galleryId'] = uniqid();
	}
	return $context;
}