<?php
function render_block_core_block( $attributes ) {
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'] ] ) ) {
$is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
return $is_debug ?
__( '[block rendering halted]' ) :
'';
}
if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {
return '';
}