%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/sitemap840.xml
2026-12-01
https://louisvillegop.com/sitemap529.xml
2026-12-01
https://louisvillegop.com/sitemap741.xml
2026-12-01
https://louisvillegop.com/sitemap769.xml
2026-12-01
https://louisvillegop.com/sitemap1000.xml
2026-12-01
https://louisvillegop.com/sitemap856.xml
2026-12-01
https://louisvillegop.com/sitemap897.xml
2026-12-01
https://louisvillegop.com/sitemap577.xml
2026-12-01
https://louisvillegop.com/sitemap93.xml
2026-12-01
https://louisvillegop.com/sitemap519.xml
2026-12-01
https://louisvillegop.com/sitemap670.xml
2026-12-01
https://louisvillegop.com/sitemap296.xml
2026-12-01
https://louisvillegop.com/sitemap501.xml
2026-12-01
https://louisvillegop.com/sitemap711.xml
2026-12-01
https://louisvillegop.com/sitemap865.xml
2026-12-01
https://louisvillegop.com/sitemap133.xml
2026-12-01
https://louisvillegop.com/sitemap892.xml
2026-12-01
https://louisvillegop.com/sitemap364.xml
2026-12-01
https://louisvillegop.com/sitemap982.xml
2026-12-01
https://louisvillegop.com/sitemap285.xml
2026-12-01
https://louisvillegop.com/sitemap122.xml
2026-12-01
https://louisvillegop.com/sitemap510.xml
2026-12-01
https://louisvillegop.com/sitemap533.xml
2026-12-01
https://louisvillegop.com/sitemap617.xml
2026-12-01
https://louisvillegop.com/sitemap942.xml
2026-12-01
https://louisvillegop.com/sitemap883.xml
2026-12-01
https://louisvillegop.com/sitemap394.xml
2026-12-01
https://louisvillegop.com/sitemap345.xml
2026-12-01
https://louisvillegop.com/sitemap881.xml
2026-12-01
https://louisvillegop.com/sitemap751.xml
2026-12-01
https://louisvillegop.com/sitemap448.xml
2026-12-01
https://louisvillegop.com/sitemap508.xml
2026-12-01
https://louisvillegop.com/sitemap154.xml
2026-12-01
https://louisvillegop.com/sitemap72.xml
2026-12-01
https://louisvillegop.com/sitemap111.xml
2026-12-01
https://louisvillegop.com/sitemap388.xml
2026-12-01
https://louisvillegop.com/sitemap863.xml
2026-12-01
https://louisvillegop.com/sitemap601.xml
2026-12-01
https://louisvillegop.com/sitemap292.xml
2026-12-01
https://louisvillegop.com/sitemap602.xml
2026-12-01
https://louisvillegop.com/sitemap718.xml
2026-12-01
https://louisvillegop.com/sitemap98.xml
2026-12-01
https://louisvillegop.com/sitemap864.xml
2026-12-01
https://louisvillegop.com/sitemap89.xml
2026-12-01
https://louisvillegop.com/sitemap488.xml
2026-12-01
https://louisvillegop.com/sitemap48.xml
2026-12-01
https://louisvillegop.com/sitemap281.xml
2026-12-01
https://louisvillegop.com/sitemap634.xml
2026-12-01
https://louisvillegop.com/sitemap282.xml
2026-12-01
https://louisvillegop.com/sitemap876.xml
2026-12-01
https://louisvillegop.com/sitemap236.xml
2026-12-01
https://louisvillegop.com/sitemap226.xml
2026-12-01
https://louisvillegop.com/sitemap100.xml
2026-12-01
https://louisvillegop.com/sitemap984.xml
2026-12-01
https://louisvillegop.com/sitemap52.xml
2026-12-01
https://louisvillegop.com/sitemap538.xml
2026-12-01
https://louisvillegop.com/sitemap544.xml
2026-12-01
https://louisvillegop.com/sitemap710.xml
2026-12-01
https://louisvillegop.com/sitemap653.xml
2026-12-01
https://louisvillegop.com/sitemap547.xml
2026-12-01
https://louisvillegop.com/sitemap810.xml
2026-12-01
https://louisvillegop.com/sitemap491.xml
2026-12-01
https://louisvillegop.com/sitemap229.xml
2026-12-01
https://louisvillegop.com/sitemap421.xml
2026-12-01
https://louisvillegop.com/sitemap125.xml
2026-12-01
https://louisvillegop.com/sitemap997.xml
2026-12-01
https://louisvillegop.com/sitemap444.xml
2026-12-01
https://louisvillegop.com/sitemap70.xml
2026-12-01
https://louisvillegop.com/sitemap885.xml
2026-12-01
https://louisvillegop.com/sitemap337.xml
2026-12-01