PATH:
home
/
ptadmin
/
public_html
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/pattern` block. * * @package WordPress */ /** * Registers the `core/pattern` block on the server. * * @since 5.9.0 */ function register_block_core_pattern() { register_block_type_from_metadata( __DIR__ . '/pattern', array( 'render_callback' => 'render_block_core_pattern', ) ); } /** * Renders the `core/pattern` block on the server. * * @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper. * * @global WP_Embed $wp_embed Used to process embedded content within patterns * * @param array $attributes Block attributes. * * @return string Returns the output of the pattern. */ function render_block_core_pattern( $attributes ) { static $seen_refs = array(); if ( empty( $attributes['slug'] ) ) { return ''; } $slug = $attributes['slug']; $registry = WP_Block_Patterns_Registry::get_instance(); if ( ! $registry->is_registered( $slug ) ) { return ''; } if ( isset( $seen_refs[ $attributes['slug'] ] ) ) { // 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. %s represents a pattern's slug. sprintf( __( '[block rendering halted for pattern "%s"]' ), $slug ) : ''; } $pattern = $registry->get_registered( $slug ); $content = $pattern['content']; // Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin. // This can be removed when the minimum supported WordPress is >= 6.4. if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) { $blocks = parse_blocks( $content ); $content = gutenberg_serialize_blocks( $blocks ); } $seen_refs[ $attributes['slug'] ] = true; $content = do_blocks( $content ); global $wp_embed; $content = $wp_embed->autoembed( $content ); unset( $seen_refs[ $attributes['slug'] ] ); return $content; } add_action( 'init', 'register_block_core_pattern' );
[+]
media-text
[+]
comments-pagination-next
[+]
table
[+]
widget-group
[-] query-no-results.php
[edit]
[+]
post-featured-image
[+]
post-template
[-] site-title.php
[edit]
[-] comment-content.php
[edit]
[-] page-list.php
[edit]
[-] search.php
[edit]
[-] shortcode.php
[edit]
[+]
comments-pagination-previous
[+]
group
[-] post-author-biography.php
[edit]
[+]
latest-comments
[+]
query-no-results
[+]
freeform
[-] require-static-blocks.php
[edit]
[+]
query-pagination
[+]
post-content
[-] post-title.php
[edit]
[+]
pattern
[-] button.php
[edit]
[-] query-pagination-numbers.php
[edit]
[+]
post-author-biography
[+]
comment-author-name
[+]
site-title
[-] error_log
[edit]
[-] site-logo.php
[edit]
[+]
navigation-link
[-] comments-pagination.php
[edit]
[-] comments.php
[edit]
[+]
columns
[+]
post-navigation-link
[-] navigation-link.php
[edit]
[+]
paragraph
[-] index.php
[edit]
[+]
comment-reply-link
[-] tag-cloud.php
[edit]
[-] site-tagline.php
[edit]
[+]
query-title
[-] post-featured-image.php
[edit]
[-] calendar.php
[edit]
[-] template-part.php
[edit]
[-] comments-title.php
[edit]
[+]
comments-pagination
[+]
text-columns
[+]
image
[+]
details
[-] comment-edit-link.php
[edit]
[+]
tag-cloud
[-] comments-pagination-previous.php
[edit]
[+]
latest-posts
[+]
button
[-] image.php
[edit]
[-] media-text.php
[edit]
[+]
missing
[+]
gallery
[+]
buttons
[+]
page-list
[+]
avatar
[-] post-date.php
[edit]
[+]
query-pagination-previous
[-] gallery.php
[edit]
[+]
spacer
[+]
term-description
[-] comment-date.php
[edit]
[-] query.php
[edit]
[+]
video
[+]
post-author-name
[+]
site-tagline
[+]
..
[-] heading.php
[edit]
[+]
social-links
[+]
comment-content
[-] legacy-widget.php
[edit]
[+]
template-part
[+]
post-date
[-] comments-pagination-next.php
[edit]
[+]
nextpage
[+]
audio
[+]
post-title
[+]
list-item
[-] comments-pagination-numbers.php
[edit]
[-] query-pagination-next.php
[edit]
[+]
comments-title
[-] social-link.php
[edit]
[+]
query-pagination-next
[+]
post-excerpt
[+]
block
[+]
home-link
[+]
comment-edit-link
[-] comment-reply-link.php
[edit]
[-] footnotes.php
[edit]
[-] query-pagination-previous.php
[edit]
[+]
column
[+]
embed
[-] post-content.php
[edit]
[+]
navigation-submenu
[+]
social-link
[+]
post-terms
[+]
legacy-widget
[+]
cover
[+]
code
[+]
archives
[-] post-author-name.php
[edit]
[+]
html
[+]
rss
[-] query-title.php
[edit]
[+]
verse
[+]
comments-pagination-numbers
[-] widget-group.php
[edit]
[-] navigation.php
[edit]
[-] block.php
[edit]
[-] page-list-item.php
[edit]
[-] loginout.php
[edit]
[-] query-pagination.php
[edit]
[-] avatar.php
[edit]
[+]
post-author
[-] post-author.php
[edit]
[-] latest-posts.php
[edit]
[-] require-dynamic-blocks.php
[edit]
[-] categories.php
[edit]
[+]
query
[+]
list
[+]
footnotes
[-] comment-template.php
[edit]
[+]
query-pagination-numbers
[+]
post-comments-form
[+]
heading
[+]
navigation
[+]
more
[-] pattern.php
[edit]
[-] file.php
[edit]
[-] term-description.php
[edit]
[-] rss.php
[edit]
[+]
read-more
[-] post-comments-form.php
[edit]
[-] post-terms.php
[edit]
[-] archives.php
[edit]
[-] latest-comments.php
[edit]
[-] blocks-json.php
[edit]
[+]
calendar
[+]
categories
[-] list.php
[edit]
[+]
comments
[+]
comment-template
[-] post-template.php
[edit]
[-] read-more.php
[edit]
[+]
search
[+]
preformatted
[+]
loginout
[+]
pullquote
[-] post-navigation-link.php
[edit]
[-] comment-author-name.php
[edit]
[+]
separator
[-] navigation-submenu.php
[edit]
[+]
quote
[+]
site-logo
[+]
file
[+]
page-list-item
[-] cover.php
[edit]
[+]
shortcode
[-] post-excerpt.php
[edit]
[+]
comment-date
[-] home-link.php
[edit]