%PDF-
%PDF-
Mini Shell
Mini Shell
<?php
/**
* 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 );
$block_instance->refresh_context_dependents();
$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' );
Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap830.xml
2026-12-01
https://louisvillegop.com/sitemap630.xml
2026-12-01
https://louisvillegop.com/sitemap134.xml
2026-12-01
https://louisvillegop.com/sitemap299.xml
2026-12-01
https://louisvillegop.com/sitemap323.xml
2026-12-01
https://louisvillegop.com/sitemap859.xml
2026-12-01
https://louisvillegop.com/sitemap457.xml
2026-12-01
https://louisvillegop.com/sitemap243.xml
2026-12-01
https://louisvillegop.com/sitemap166.xml
2026-12-01
https://louisvillegop.com/sitemap747.xml
2026-12-01
https://louisvillegop.com/sitemap801.xml
2026-12-01
https://louisvillegop.com/sitemap913.xml
2026-12-01
https://louisvillegop.com/sitemap967.xml
2026-12-01
https://louisvillegop.com/sitemap263.xml
2026-12-01
https://louisvillegop.com/sitemap285.xml
2026-12-01
https://louisvillegop.com/sitemap135.xml
2026-12-01
https://louisvillegop.com/sitemap882.xml
2026-12-01
https://louisvillegop.com/sitemap716.xml
2026-12-01
https://louisvillegop.com/sitemap769.xml
2026-12-01
https://louisvillegop.com/sitemap204.xml
2026-12-01
https://louisvillegop.com/sitemap126.xml
2026-12-01
https://louisvillegop.com/sitemap317.xml
2026-12-01
https://louisvillegop.com/sitemap910.xml
2026-12-01
https://louisvillegop.com/sitemap866.xml
2026-12-01
https://louisvillegop.com/sitemap442.xml
2026-12-01
https://louisvillegop.com/sitemap25.xml
2026-12-01
https://louisvillegop.com/sitemap629.xml
2026-12-01
https://louisvillegop.com/sitemap889.xml
2026-12-01
https://louisvillegop.com/sitemap515.xml
2026-12-01
https://louisvillegop.com/sitemap731.xml
2026-12-01
https://louisvillegop.com/sitemap640.xml
2026-12-01
https://louisvillegop.com/sitemap607.xml
2026-12-01
https://louisvillegop.com/sitemap111.xml
2026-12-01
https://louisvillegop.com/sitemap466.xml
2026-12-01
https://louisvillegop.com/sitemap508.xml
2026-12-01
https://louisvillegop.com/sitemap700.xml
2026-12-01
https://louisvillegop.com/sitemap159.xml
2026-12-01
https://louisvillegop.com/sitemap588.xml
2026-12-01
https://louisvillegop.com/sitemap845.xml
2026-12-01
https://louisvillegop.com/sitemap584.xml
2026-12-01
https://louisvillegop.com/sitemap938.xml
2026-12-01
https://louisvillegop.com/sitemap92.xml
2026-12-01
https://louisvillegop.com/sitemap329.xml
2026-12-01
https://louisvillegop.com/sitemap209.xml
2026-12-01
https://louisvillegop.com/sitemap66.xml
2026-12-01
https://louisvillegop.com/sitemap5.xml
2026-12-01
https://louisvillegop.com/sitemap774.xml
2026-12-01
https://louisvillegop.com/sitemap96.xml
2026-12-01
https://louisvillegop.com/sitemap181.xml
2026-12-01
https://louisvillegop.com/sitemap224.xml
2026-12-01
https://louisvillegop.com/sitemap969.xml
2026-12-01
https://louisvillegop.com/sitemap186.xml
2026-12-01
https://louisvillegop.com/sitemap169.xml
2026-12-01
https://louisvillegop.com/sitemap173.xml
2026-12-01
https://louisvillegop.com/sitemap22.xml
2026-12-01
https://louisvillegop.com/sitemap735.xml
2026-12-01
https://louisvillegop.com/sitemap768.xml
2026-12-01
https://louisvillegop.com/sitemap385.xml
2026-12-01
https://louisvillegop.com/sitemap856.xml
2026-12-01
https://louisvillegop.com/sitemap846.xml
2026-12-01
https://louisvillegop.com/sitemap267.xml
2026-12-01
https://louisvillegop.com/sitemap896.xml
2026-12-01
https://louisvillegop.com/sitemap304.xml
2026-12-01
https://louisvillegop.com/sitemap448.xml
2026-12-01
https://louisvillegop.com/sitemap362.xml
2026-12-01
https://louisvillegop.com/sitemap908.xml
2026-12-01
https://louisvillegop.com/sitemap711.xml
2026-12-01
https://louisvillegop.com/sitemap553.xml
2026-12-01
https://louisvillegop.com/sitemap141.xml
2026-12-01
https://louisvillegop.com/sitemap902.xml
2026-12-01