PATH:
home
/
bkunreyz
/
leadstax.com
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/image` block. * * @package WordPress */ /** * Renders the `core/image` block on the server, * adding a data-id attribute to the element if core/gallery has added on pre-render. * * @param array $attributes The block attributes. * @param string $content The block content. * @return string Returns the block content with the data-id attribute added. */ function render_block_core_image( $attributes, $content ) { if ( isset( $attributes['data-id'] ) ) { // Add the data-id="$id" attribute to the img element // to provide backwards compatibility for the Gallery Block, // which now wraps Image Blocks within innerBlocks. // The data-id attribute is added in a core/gallery `render_block_data` hook. $data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"'; if ( ! str_contains( $content, $data_id_attribute ) ) { $content = str_replace( '<img', '<img ' . $data_id_attribute . ' ', $content ); } } return $content; } /** * Registers the `core/image` block on server. */ function register_block_core_image() { register_block_type_from_metadata( __DIR__ . '/image', array( 'render_callback' => 'render_block_core_image', ) ); } add_action( 'init', 'register_block_core_image' );
[+]
group
[+]
list
[+]
post-template
[+]
freeform
[+]
comments-pagination-next
[+]
post-terms
[+]
legacy-widget
[+]
site-logo
[-] post-author-name.php
[edit]
[+]
calendar
[+]
columns
[+]
image
[+]
file
[-] post-excerpt.php
[edit]
[-] navigation.php
[edit]
[+]
comments-pagination-previous
[+]
comment-content
[+]
pullquote
[+]
navigation
[-] site-title.php
[edit]
[+]
query-pagination-next
[+]
comments-title
[+]
block
[+]
query-title
[+]
latest-comments
[+]
missing
[+]
heading
[-] tag-cloud.php
[edit]
[+]
navigation-link
[+]
comment-edit-link
[+]
query-pagination-previous
[+]
loginout
[+]
read-more
[+]
gallery
[-] navigation-link.php
[edit]
[+]
cover
[+]
query-pagination
[+]
buttons
[+]
post-date
[+]
widget-group
[+]
shortcode
[+]
spacer
[+]
post-title
[-] comment-edit-link.php
[edit]
[+]
page-list-item
[+]
quote
[+]
nextpage
[+]
search
[+]
tag-cloud
[-] site-tagline.php
[edit]
[+]
post-comments-form
[+]
post-author-name
[-] post-template.php
[edit]
[+]
..
[+]
post-featured-image
[+]
text-columns
[+]
rss
[+]
embed
[+]
comment-template
[+]
latest-posts
[+]
term-description
[-] comment-content.php
[edit]
[+]
comments
[+]
post-excerpt
[+]
preformatted
[+]
html
[+]
post-navigation-link
[+]
post-author-biography
[-] categories.php
[edit]
[-] comments-pagination.php
[edit]
[+]
query
[+]
comment-reply-link
[+]
media-text
[+]
social-link
[+]
pattern
[+]
video
[-] post-featured-image.php
[edit]
[-] comments.php
[edit]
[+]
home-link
[+]
comments-pagination-numbers
[+]
more
[+]
comment-date
[+]
comment-author-name
[+]
post-content
[+]
list-item
[+]
social-links
[+]
query-pagination-numbers
[+]
template-part
[+]
query-no-results
[+]
separator
[+]
paragraph
[+]
site-tagline
[+]
audio
[+]
button
[+]
code
[+]
categories
[+]
navigation-submenu
[+]
post-author
[-] latest-comments.php
[edit]
[-] avatar.php
[edit]
[+]
table
[+]
comments-pagination
[+]
page-list
[+]
verse
[+]
site-title
[+]
archives
[+]
avatar
[-] image.php
[edit]