PATH:
home
/
fengshp
/
www
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/file` block. * * @package WordPress */ /** * When the `core/file` block is rendering, check if we need to enqueue the `wp-block-file-view` script. * * @since 5.8.0 * * @param array $attributes The block attributes. * @param string $content The block content. * @param WP_Block $block The parsed block. * * @return string Returns the block content. */ function render_block_core_file( $attributes, $content ) { // If it's interactive, enqueue the script module and add the directives. if ( ! empty( $attributes['displayPreview'] ) ) { wp_enqueue_script_module( '@wordpress/block-library/file/view' ); $processor = new WP_HTML_Tag_Processor( $content ); $processor->next_tag(); $processor->set_attribute( 'data-wp-interactive', 'core/file' ); $processor->next_tag( 'object' ); $processor->set_attribute( 'data-wp-bind--hidden', '!state.hasPdfPreview' ); $processor->set_attribute( 'hidden', true ); $filename = $processor->get_attribute( 'aria-label' ); $has_filename = ! empty( $filename ) && 'PDF embed' !== $filename; $label = $has_filename ? sprintf( /* translators: %s: filename. */ __( 'Embed of %s.' ), $filename ) : __( 'PDF embed' ); // Update object's aria-label attribute if present in block HTML. // Match an aria-label attribute from an object tag. $processor->set_attribute( 'aria-label', $label ); return $processor->get_updated_html(); } return $content; } /** * Registers the `core/file` block on server. * * @since 5.8.0 */ function register_block_core_file() { register_block_type_from_metadata( __DIR__ . '/file', array( 'render_callback' => 'render_block_core_file', ) ); } add_action( 'init', 'register_block_core_file' );
[+]
..
[+]
comment-date
[-] site-tagline.php
[edit]
[-] post-title.php
[edit]
[-] comment-reply-link.php
[edit]
[-] query.php
[edit]
[+]
missing
[+]
archives
[-] archives.php
[edit]
[+]
shortcode
[-] query-pagination.php
[edit]
[-] file.php
[edit]
[+]
audio
[+]
list-item
[-] pattern.php
[edit]
[+]
avatar
[+]
nextpage
[+]
comments-pagination-next
[+]
cover
[+]
navigation-submenu
[+]
post-author
[-] tag-cloud.php
[edit]
[+]
query-pagination-previous
[+]
term-description
[-] page-list-item.php
[edit]
[+]
calendar
[-] footnotes.php
[edit]
[+]
post-featured-image
[-] gallery.php
[edit]
[+]
verse
[+]
social-link
[+]
preformatted
[-] comment-edit-link.php
[edit]
[-] navigation-submenu.php
[edit]
[+]
query-no-results
[+]
query-title
[+]
comments-pagination-previous
[-] query-no-results.php
[edit]
[-] button.php
[edit]
[-] post-navigation-link.php
[edit]
[+]
quote
[+]
post-terms
[+]
table
[+]
template-part
[+]
comments-pagination
[-] comment-template.php
[edit]
[+]
page-list-item
[+]
loginout
[+]
separator
[-] widget-group.php
[edit]
[-] require-dynamic-blocks.php
[edit]
[+]
details
[+]
image
[-] navigation-link.php
[edit]
[+]
post-author-name
[+]
comments-pagination-numbers
[-] query-pagination-previous.php
[edit]
[+]
post-comments-form
[+]
comment-reply-link
[-] home-link.php
[edit]
[-] template-part.php
[edit]
[-] comment-author-name.php
[edit]
[+]
post-content
[+]
media-text
[+]
latest-posts
[-] social-link.php
[edit]
[-] post-comments-form.php
[edit]
[+]
pullquote
[-] loginout.php
[edit]
[+]
query-pagination-numbers
[-] index.php
[edit]
[-] post-content.php
[edit]
[+]
post-template
[+]
rss
[+]
post-date
[+]
file
[+]
group
[-] term-description.php
[edit]
[-] latest-comments.php
[edit]
[+]
spacer
[+]
comment-edit-link
[+]
post-author-biography
[+]
list
[-] legacy-widget.php
[edit]
[+]
more
[-] cover.php
[edit]
[-] post-date.php
[edit]
[-] comments.php
[edit]
[+]
gallery
[-] comment-content.php
[edit]
[+]
paragraph
[+]
comments
[-] categories.php
[edit]
[-] post-terms.php
[edit]
[+]
footnotes
[+]
widget-group
[+]
categories
[+]
social-links
[-] calendar.php
[edit]
[-] image.php
[edit]
[+]
comment-content
[-] rss.php
[edit]
[+]
post-title
[-] list.php
[edit]
[-] query-pagination-next.php
[edit]
[-] comments-pagination-previous.php
[edit]
[+]
comment-author-name
[+]
heading
[-] post-author-biography.php
[edit]
[-] post-template.php
[edit]
[+]
search
[+]
code
[-] read-more.php
[edit]
[-] comments-title.php
[edit]
[-] post-featured-image.php
[edit]
[+]
video
[+]
site-logo
[+]
query
[-] comments-pagination-next.php
[edit]
[-] site-logo.php
[edit]
[+]
query-total
[+]
html
[-] avatar.php
[edit]
[+]
tag-cloud
[+]
classic
[+]
post-navigation-link
[+]
text-columns
[+]
embed
[+]
freeform
[-] block.php
[edit]
[-] comments-pagination.php
[edit]
[-] search.php
[edit]
[+]
legacy-widget
[-] heading.php
[edit]
[+]
site-title
[+]
block
[+]
navigation
[-] post-author-name.php
[edit]
[+]
page-list
[+]
navigation-link
[-] query-pagination-numbers.php
[edit]
[-] shortcode.php
[edit]
[-] site-title.php
[edit]
[+]
latest-comments
[+]
buttons
[+]
columns
[+]
comments-title
[-] query-total.php
[edit]
[-] post-author.php
[edit]
[-] post-excerpt.php
[edit]
[+]
query-pagination
[-] query-title.php
[edit]
[+]
query-pagination-next
[+]
site-tagline
[+]
comment-template
[+]
post-excerpt
[+]
pattern
[+]
read-more
[+]
column
[-] blocks-json.php
[edit]
[+]
home-link
[-] require-static-blocks.php
[edit]
[-] latest-posts.php
[edit]
[-] navigation.php
[edit]
[-] comments-pagination-numbers.php
[edit]
[+]
button
[-] media-text.php
[edit]
[-] comment-date.php
[edit]
[-] page-list.php
[edit]