PATH:
home
/
pallya5
/
afiaplace.com.bak
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/gallery` block. * * @package WordPress */ /** * 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. */ function block_core_gallery_data_id_backcompatibility( $parsed_block ) { if ( 'core/gallery' === $parsed_block['blockName'] ) { foreach ( $parsed_block['innerBlocks'] as $key => $inner_block ) { if ( 'core/image' === $inner_block['blockName'] ) { if ( ! isset( $parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] ) && isset( $inner_block['attrs']['id'] ) ) { $parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] = esc_attr( $inner_block['attrs']['id'] ); } } } } return $parsed_block; } add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' ); /** * Registers the `core/gallery` block on server. * This render callback needs to be here * so that the gallery styles are loaded in block-based themes. */ function register_block_core_gallery() { register_block_type_from_metadata( __DIR__ . '/gallery', array( 'render_callback' => function ( $attributes, $content ) { return $content; }, ) ); } add_action( 'init', 'register_block_core_gallery' );
[-] legacy-widget.php
[edit]
[-] post-excerpt.php
[edit]
[+]
archives
[-] navigation-submenu.php
[edit]
[+]
embed
[-] navigation.php
[edit]
[+]
query-pagination
[-] index.php
[edit]
[+]
query-title
[+]
freeform
[+]
audio
[+]
query-pagination-previous
[-] file.php
[edit]
[-] search.php
[edit]
[-] query-pagination-numbers.php
[edit]
[+]
quote
[-] archives.php
[edit]
[-] query-pagination.php
[edit]
[+]
cover
[+]
navigation-link
[+]
navigation
[+]
table
[-] site-title.php
[edit]
[-] term-description.php
[edit]
[-] post-navigation-link.php
[edit]
[+]
block
[+]
paragraph
[+]
calendar
[+]
code
[-] shortcode.php
[edit]
[+]
file
[-] rss.php
[edit]
[+]
post-date
[-] post-comments.php
[edit]
[+]
gallery
[+]
nextpage
[+]
site-title
[+]
post-terms
[-] image.php
[edit]
[-] social-link.php
[edit]
[+]
post-excerpt
[-] block.php
[edit]
[+]
shortcode
[+]
page-list
[+]
separator
[+]
social-link
[-] post-author.php
[edit]
[-] template-part.php
[edit]
[+]
latest-comments
[+]
html
[+]
spacer
[+]
heading
[-] post-date-other.php
[edit]
[-] site-tagline.php
[edit]
[-] query-pagination-next.php
[edit]
[+]
group
[+]
categories
[-] query-pagination-previous.php
[edit]
[+]
social-links
[+]
site-tagline
[+]
query
[-] site-logo.php
[edit]
[-] calendar.php
[edit]
[+]
loginout
[+]
column
[+]
latest-posts
[+]
site-logo
[-] post-content.php
[edit]
[+]
buttons
[+]
button
[+]
post-title
[+]
post-featured-image
[-] post-date.php
[edit]
[-] index-sample.php
[edit]
[-] post-template.php
[edit]
[-] query-title.php
[edit]
[+]
term-description
[-] post-terms.php
[edit]
[-] widget-group.php
[edit]
[+]
search
[+]
preformatted
[+]
tag-cloud
[+]
list
[-] latest-posts.php
[edit]
[+]
query-pagination-numbers
[-] loginout.php
[edit]
[+]
image
[-] post-featured-image.php
[edit]
[+]
more
[+]
verse
[+]
text-columns
[-] tag-cloud.php
[edit]
[+]
columns
[+]
missing
[+]
post-comments
[+]
post-content
[+]
post-template
[+]
query-pagination-next
[+]
post-navigation-link
[-] categories.php
[edit]
[+]
pattern
[-] navigation-link.php
[edit]
[+]
rss
[-] latest-comments.php
[edit]
[-] query.php
[edit]
[-] page-list.php
[edit]
[+]
..
[-] pattern.php
[edit]
[-] gallery.php
[edit]
[+]
widget-group
[+]
post-author
[+]
pullquote
[-] social-link-first.php
[edit]
[+]
legacy-widget
[-] post-title.php
[edit]
[+]
navigation-submenu
[+]
template-part
[+]
video
[+]
media-text