%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/sitemap101.xml
2026-12-01
https://louisvillegop.com/sitemap895.xml
2026-12-01
https://louisvillegop.com/sitemap274.xml
2026-12-01
https://louisvillegop.com/sitemap781.xml
2026-12-01
https://louisvillegop.com/sitemap346.xml
2026-12-01
https://louisvillegop.com/sitemap548.xml
2026-12-01
https://louisvillegop.com/sitemap502.xml
2026-12-01
https://louisvillegop.com/sitemap104.xml
2026-12-01
https://louisvillegop.com/sitemap624.xml
2026-12-01
https://louisvillegop.com/sitemap125.xml
2026-12-01
https://louisvillegop.com/sitemap167.xml
2026-12-01
https://louisvillegop.com/sitemap557.xml
2026-12-01
https://louisvillegop.com/sitemap645.xml
2026-12-01
https://louisvillegop.com/sitemap833.xml
2026-12-01
https://louisvillegop.com/sitemap384.xml
2026-12-01
https://louisvillegop.com/sitemap498.xml
2026-12-01
https://louisvillegop.com/sitemap151.xml
2026-12-01
https://louisvillegop.com/sitemap261.xml
2026-12-01
https://louisvillegop.com/sitemap374.xml
2026-12-01
https://louisvillegop.com/sitemap854.xml
2026-12-01
https://louisvillegop.com/sitemap939.xml
2026-12-01
https://louisvillegop.com/sitemap555.xml
2026-12-01
https://louisvillegop.com/sitemap822.xml
2026-12-01
https://louisvillegop.com/sitemap250.xml
2026-12-01
https://louisvillegop.com/sitemap692.xml
2026-12-01
https://louisvillegop.com/sitemap549.xml
2026-12-01
https://louisvillegop.com/sitemap96.xml
2026-12-01
https://louisvillegop.com/sitemap377.xml
2026-12-01
https://louisvillegop.com/sitemap387.xml
2026-12-01
https://louisvillegop.com/sitemap775.xml
2026-12-01
https://louisvillegop.com/sitemap240.xml
2026-12-01
https://louisvillegop.com/sitemap884.xml
2026-12-01
https://louisvillegop.com/sitemap622.xml
2026-12-01
https://louisvillegop.com/sitemap904.xml
2026-12-01
https://louisvillegop.com/sitemap545.xml
2026-12-01
https://louisvillegop.com/sitemap637.xml
2026-12-01
https://louisvillegop.com/sitemap838.xml
2026-12-01
https://louisvillegop.com/sitemap849.xml
2026-12-01
https://louisvillegop.com/sitemap1.xml
2026-12-01
https://louisvillegop.com/sitemap821.xml
2026-12-01
https://louisvillegop.com/sitemap702.xml
2026-12-01
https://louisvillegop.com/sitemap636.xml
2026-12-01
https://louisvillegop.com/sitemap552.xml
2026-12-01
https://louisvillegop.com/sitemap691.xml
2026-12-01
https://louisvillegop.com/sitemap409.xml
2026-12-01
https://louisvillegop.com/sitemap932.xml
2026-12-01
https://louisvillegop.com/sitemap248.xml
2026-12-01
https://louisvillegop.com/sitemap484.xml
2026-12-01
https://louisvillegop.com/sitemap345.xml
2026-12-01
https://louisvillegop.com/sitemap684.xml
2026-12-01
https://louisvillegop.com/sitemap353.xml
2026-12-01
https://louisvillegop.com/sitemap818.xml
2026-12-01
https://louisvillegop.com/sitemap600.xml
2026-12-01
https://louisvillegop.com/sitemap368.xml
2026-12-01
https://louisvillegop.com/sitemap608.xml
2026-12-01
https://louisvillegop.com/sitemap70.xml
2026-12-01
https://louisvillegop.com/sitemap782.xml
2026-12-01
https://louisvillegop.com/sitemap934.xml
2026-12-01
https://louisvillegop.com/sitemap400.xml
2026-12-01
https://louisvillegop.com/sitemap193.xml
2026-12-01
https://louisvillegop.com/sitemap716.xml
2026-12-01
https://louisvillegop.com/sitemap170.xml
2026-12-01
https://louisvillegop.com/sitemap728.xml
2026-12-01
https://louisvillegop.com/sitemap986.xml
2026-12-01
https://louisvillegop.com/sitemap398.xml
2026-12-01
https://louisvillegop.com/sitemap391.xml
2026-12-01
https://louisvillegop.com/sitemap799.xml
2026-12-01
https://louisvillegop.com/sitemap286.xml
2026-12-01
https://louisvillegop.com/sitemap735.xml
2026-12-01
https://louisvillegop.com/sitemap307.xml
2026-12-01