[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/blocks/ -> gallery.php (summary)

Server-side rendering of the `core/gallery` block.

File Size: 86 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 functions

  block_core_gallery_data_id_backcompatibility()
  block_core_gallery_render()
  register_block_core_gallery()

Functions
Functions that are not part of a class:

block_core_gallery_data_id_backcompatibility( $parsed_block )   X-Ref
Handles backwards compatibility for Gallery Blocks,
whose images feature a `data-id` attribute.

Now that the Gallery Block contains inner Image Blocks,
we add a custom `data-id` attribute before rendering the gallery
so that the Image Block can pick it up in its render_callback.

param: array $parsed_block The block being rendered.
return: array The migrated block object.

block_core_gallery_render( $attributes, $content )   X-Ref
Adds a style tag for the --wp--style--unstable-gallery-gap var.

The Gallery block needs to recalculate Image block width based on
the current gap setting in order to maintain the number of flex columns
so a css var is added to allow this.

param: array  $attributes Attributes of the block being rendered.
param: string $content Content of the block being rendered.
return: string The content of the block being rendered.

register_block_core_gallery()   X-Ref
No description



Generated: Tue Jun 28 01:00:03 2022 Cross-referenced by PHPXref 0.7.1