7.4.33 | Linux x86_64
Server128.199.10.0
Userwww-data (uid:33)
PHP7.4.33 (apache2handler)
Terminal
Upload
Files: /var/www/html/wp-includes/blocks
View: block.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName // Needed for WP_Block_Cloner helper class. /** * Server-side rendering of the `core/block` block. * * @package WordPress */ /** * Renders the `core/block` block on server. * * @since 5.0.0 * * @global WP_Embed $wp_embed * * @param array $attributes The block attributes. * * @return string Rendered HTML of the referenced block. */ function render_block_core_block( $attributes, $content, $block_instance ) { static $seen_refs = array(); if ( empty( $attributes['ref'] ) ) { return ''; } $reusable_block = get_post( $attributes['ref'] ); if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) { return ''; } if ( isset( $seen_refs[ $attributes['ref'] ] ) ) { // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent // is set in `wp_debug_mode()`. $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; return $is_debug ? // translators: Visible only in the front end, this warning takes the place of a faulty block. __( '[block rendering halted]' ) : ''; } if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) { return ''; } $seen_refs[ $attributes['ref'] ] = true; // Handle embeds for reusable blocks. global $wp_embed; $content = $wp_embed->run_shortcode( $reusable_block->post_content ); $content = $wp_embed->autoembed( $content ); // Back compat. // For blocks that have not been migrated in the editor, add some back compat // so that front-end rendering continues to work. // This matches the `v2` deprecation. Removes the inner `values` property // from every item. if ( isset( $attributes['content'] ) ) { foreach ( $attributes['content'] as &$content_data ) { if ( isset( $content_data['values'] ) ) { $is_assoc_array = is_array( $content_data['values'] ) && ! wp_is_numeric_array( $content_data['values'] ); if ( $is_assoc_array ) { $content_data = $content_data['values']; } } } } // This matches the `v1` deprecation. Rename `overrides` to `content`. if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) { $attributes['content'] = $attributes['overrides']; } // Apply Block Hooks. $content = apply_block_hooks_to_content_from_post_object( $content, $reusable_block ); /** * We attach the blocks from $content as inner blocks to the Synced Pattern block instance. * This ensures that block context available to the Synced Pattern block instance is provided to * those blocks. */ $block_instance->parsed_block['innerBlocks'] = parse_blocks( $content ); $block_instance->parsed_block['innerContent'] = array_fill( 0, count( $block_instance->parsed_block['innerBlocks'] ), null ); if ( method_exists( $block_instance, 'refresh_context_dependents' ) ) { // WP_Block::refresh_context_dependents() was introduced in WordPress 6.8. $block_instance->refresh_context_dependents(); } else { // This branch can be removed once Gutenberg requires WordPress 6.8 or later. if ( ! class_exists( 'WP_Block_Cloner' ) ) { // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingClassSinceTag class WP_Block_Cloner extends WP_Block { /** * Static methods of subclasses have access to protected properties * of instances of the parent class. * In this case, this gives us access to `available_context` and `registry`. */ // phpcs:ignore Gutenberg.Commenting.SinceTag.MissingMethodSinceTag public static function clone_instance( $instance ) { return new WP_Block( $instance->parsed_block, $instance->available_context, $instance->registry ); } } } $block_instance = WP_Block_Cloner::clone_instance( $block_instance ); } $content = $block_instance->render( array( 'dynamic' => false ) ); unset( $seen_refs[ $attributes['ref'] ] ); return $content; } /** * Registers the `core/block` block. * * @since 5.3.0 */ function register_block_core_block() { register_block_type_from_metadata( __DIR__ . '/block', array( 'render_callback' => 'render_block_core_block', ) ); } add_action( 'init', 'register_block_core_block' );
NameSizeActions
accordion/--
accordion-heading/--
accordion-item/--
accordion-item.php3KView Edit Del
accordion-panel/--
accordion.php1.1KView Edit Del
archives/--
archives.php4.3KView Edit Del
audio/--
avatar/--
avatar.php5.5KView Edit Del
block/--
block.php4.1KView Edit Del
blocks-json.php194.5KView Edit Del
breadcrumbs/--
breadcrumbs.php18.6KView Edit Del
button/--
button.php1.7KView Edit Del
buttons/--
calendar/--
calendar.php5.9KView Edit Del
categories/--
categories.php4.8KView Edit Del
code/--
column/--
columns/--
comment-author-name/--
comment-author-name.php2.1KView Edit Del
comment-content/--
comment-content.php2.4KView Edit Del
comment-date/--
comment-date.php1.8KView Edit Del
comment-edit-link/--
comment-edit-link.php1.7KView Edit Del
comment-reply-link/--
comment-reply-link.php2KView Edit Del
comment-template/--
comment-template.php4.4KView Edit Del
comments/--
comments-pagination/--
comments-pagination-next/--
comments-pagination-next.php1.9KView Edit Del
comments-pagination-numbers/--
comments-pagination-numbers.php1.6KView Edit Del
comments-pagination-previous/--
comments-pagination-previous.php1.7KView Edit Del
comments-pagination.php1.2KView Edit Del
comments-title/--
comments-title.php2.7KView Edit Del
comments.php6.6KView Edit Del
cover/--
cover.php7.2KView Edit Del
details/--
details.php1.5KView Edit Del
embed/--
file/--
file.php1.8KView Edit Del
footnotes/--
footnotes.php3.7KView Edit Del
freeform/--
gallery/--
gallery.php8.9KView Edit Del
group/--
heading/--
heading.php1.3KView Edit Del
home-link/--
home-link.php5.3KView Edit Del
html/--
icon/--
icon.php4KView Edit Del
image/--
image.php17.2KView Edit Del
index.php5KView Edit Del
latest-comments/--
latest-comments.php5.4KView Edit Del
latest-posts/--
latest-posts.php8.6KView Edit Del
legacy-widget/--
legacy-widget.php3.9KView Edit Del
list/--
list-item/--
list.php1.2KView Edit Del
loginout/--
loginout.php1.6KView Edit Del
math/--
media-text/--
media-text.php4.2KView Edit Del
missing/--
more/--
navigation/--
navigation-link/--
navigation-link.php15.8KView Edit Del
navigation-overlay-close/--
navigation-overlay-close.php1.7KView Edit Del
navigation-submenu/--
navigation-submenu.php11.5KView Edit Del
navigation.php63.3KView Edit Del
nextpage/--
page-list/--
page-list-item/--
page-list-item.php361BView Edit Del
page-list.php14.7KView Edit Del
paragraph/--
paragraph.php1.1KView Edit Del
pattern/--
pattern.php1.7KView Edit Del
post-author/--
post-author-biography/--
post-author-biography.php1.5KView Edit Del
post-author-name/--
post-author-name.php1.9KView Edit Del
post-author.php2.7KView Edit Del
post-comments-count/--
post-comments-count.php1.2KView Edit Del
post-comments-form/--
post-comments-form.php2.7KView Edit Del
post-comments-link/--
post-comments-link.php2.2KView Edit Del
post-content/--
post-content.php2.3KView Edit Del
post-date/--
post-date.php3.6KView Edit Del
post-excerpt/--
post-excerpt.php4.2KView Edit Del
post-featured-image/--
post-featured-image.php9KView Edit Del
post-navigation-link/--
post-navigation-link.php4.7KView Edit Del
post-template/--
post-template.php5.6KView Edit Del
post-terms/--
post-terms.php3.6KView Edit Del
post-time-to-read/--
post-time-to-read.php6.3KView Edit Del
post-title/--
post-title.php2.1KView Edit Del
preformatted/--
pullquote/--
query/--
query-no-results/--
query-no-results.php1.8KView Edit Del
query-pagination/--
query-pagination-next/--
query-pagination-next.php3.6KView Edit Del
query-pagination-numbers/--
query-pagination-numbers.php4.6KView Edit Del
query-pagination-previous/--
query-pagination-previous.php3.4KView Edit Del
query-pagination.php1.1KView Edit Del
query-title/--
query-title.php2.7KView Edit Del
query-total/--
query-total.php2.4KView Edit Del
query.php5.6KView Edit Del
quote/--
read-more/--
read-more.php1.8KView Edit Del
require-dynamic-blocks.php4.9KView Edit Del
require-static-blocks.php520BView Edit Del
rss/--
rss.php4.5KView Edit Del
search/--
search.php23.3KView Edit Del
separator/--
shortcode/--
shortcode.php735BView Edit Del
site-logo/--
site-logo.php6.2KView Edit Del
site-tagline/--
site-tagline.php1.2KView Edit Del
site-title/--
site-title.php1.8KView Edit Del
social-link/--
social-link.php66KView Edit Del
social-links/--
spacer/--
table/--
tag-cloud/--
tag-cloud.php1.6KView Edit Del
template-part/--
template-part.php10.2KView Edit Del
term-count/--
term-count.php1.8KView Edit Del
term-description/--
term-description.php1.7KView Edit Del
term-name/--
term-name.php2KView Edit Del
term-template/--
term-template.php4.4KView Edit Del
terms-query/--
text-columns/--
verse/--
video/--
video.php2.7KView Edit Del
widget-group/--
widget-group.php2.4KView Edit Del