wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



block_core_gallery_render_context › WordPress Function

Od7.0.0
Przestarzałyn/a
› block_core_gallery_render_context ( $context, $parsed_block )
Parametry: (2)
  • (array) $context Default context.
    Wymagane: Tak
  • (array) $parsed_block Block being rendered, filtered by render_block_data.
    Wymagane: Tak
Powrót:
  • (array) Filtered context.
Zdefiniowane na:
Codex:

Adds a unique ID to the gallery block context.



Źródło

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