PATH:
home
/
hunkmedicalstaff
/
.trash
/
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' );
[+]
freeform
[+]
page-list-item
[-] query-pagination-numbers.php
[edit]
[+]
comment-content
[+]
comments-title
[-] tag-cloud.php
[edit]
[-] query-pagination-previous.php
[edit]
[-] post-excerpt.php
[edit]
[-] index.php
[edit]
[-] widget-group.php
[edit]
[+]
post-comments-form
[+]
comment-author-name
[+]
template-part
[-] site-tagline.php
[edit]
[-] post-featured-image.php
[edit]
[-] comment-template.php
[edit]
[+]
widget-group
[+]
query-pagination-previous
[+]
block
[-] latest-posts.php
[edit]
[-] search.php
[edit]
[-] comments-pagination.php
[edit]
[+]
table
[-] navigation-submenu.php
[edit]
[-] post-navigation-link.php
[edit]
[+]
pattern
[+]
heading
[-] comment-content.php
[edit]
[+]
audio
[+]
paragraph
[+]
nextpage
[+]
tag-cloud
[+]
categories
[-] term-description.php
[edit]
[+]
image
[+]
query-pagination-numbers
[+]
post-author-biography
[+]
post-terms
[+]
navigation-submenu
[-] read-more.php
[edit]
[+]
site-tagline
[-] legacy-widget.php
[edit]
[-] page-list-item.php
[edit]
[-] query-title.php
[edit]
[-] categories.php
[edit]
[+]
list-item
[-] require-dynamic-blocks.php
[edit]
[+]
rss
[+]
html
[-] comments-pagination-numbers.php
[edit]
[+]
column
[+]
separator
[+]
quote
[+]
legacy-widget
[+]
code
[+]
comments
[+]
file
[+]
buttons
[-] image.php
[edit]
[-] cover.php
[edit]
[-] site-logo.php
[edit]
[+]
pullquote
[-] comments-pagination-next.php
[edit]
[-] query.php
[edit]
[+]
navigation-link
[+]
list
[+]
query-pagination-next
[-] comment-author-name.php
[edit]
[+]
comments-pagination
[-] post-comments-form.php
[edit]
[-] heading.php
[edit]
[-] post-date.php
[edit]
[+]
comments-pagination-next
[-] navigation.php
[edit]
[-] comments.php
[edit]
[+]
comments-pagination-numbers
[+]
preformatted
[-] query-pagination.php
[edit]
[-] loginout.php
[edit]
[+]
post-author-name
[+]
group
[-] template-part.php
[edit]
[-] home-link.php
[edit]
[+]
shortcode
[+]
query-title
[+]
latest-posts
[-] comment-reply-link.php
[edit]
[-] calendar.php
[edit]
[+]
comment-edit-link
[+]
video
[-] query-no-results.php
[edit]
[-] rss.php
[edit]
[-] comment-date.php
[edit]
[+]
query-total
[+]
post-featured-image
[+]
comments-pagination-previous
[+]
details
[+]
gallery
[+]
comment-template
[-] comments-pagination-previous.php
[edit]
[-] query-total.php
[edit]
[-] page-list.php
[edit]
[+]
read-more
[-] social-link.php
[edit]
[+]
post-excerpt
[-] post-author-biography.php
[edit]
[+]
post-template
[+]
post-title
[+]
navigation
[+]
..
[+]
button
[+]
query-pagination
[+]
post-author
[-] gallery.php
[edit]
[+]
page-list
[+]
post-date
[-] media-text.php
[edit]
[-] archives.php
[edit]
[-] footnotes.php
[edit]
[+]
spacer
[+]
latest-comments
[-] shortcode.php
[edit]
[-] navigation-link.php
[edit]
[+]
archives
[+]
columns
[+]
post-navigation-link
[-] site-title.php
[edit]
[-] require-static-blocks.php
[edit]
[+]
site-logo
[+]
loginout
[+]
search
[+]
term-description
[-] post-title.php
[edit]
[-] post-terms.php
[edit]
[+]
embed
[-] blocks-json.php
[edit]
[+]
more
[+]
media-text
[-] list.php
[edit]
[+]
cover
[+]
query-no-results
[+]
site-title
[+]
footnotes
[+]
missing
[+]
post-content
[-] comment-edit-link.php
[edit]
[+]
social-link
[+]
home-link
[-] post-content.php
[edit]
[-] post-author-name.php
[edit]
[-] post-author.php
[edit]
[+]
calendar
[-] avatar.php
[edit]
[-] pattern.php
[edit]
[-] query-pagination-next.php
[edit]
[-] file.php
[edit]
[+]
query
[+]
verse
[-] button.php
[edit]
[+]
avatar
[+]
comment-reply-link
[+]
text-columns
[+]
social-links
[+]
comment-date
[-] block.php
[edit]
[-] latest-comments.php
[edit]
[-] comments-title.php
[edit]
[-] post-template.php
[edit]