W3cubDocs

/WordPress

render_block_core_block( array $attributes )

Renders the core/block block on server.

Description

Parameters

$attributes

(array) (Required) The block attributes.

Return

(string) Rendered HTML of the referenced block.

Source

File: wp-includes/blocks/block.php

function render_block_core_block( $attributes ) {
	if ( empty( $attributes['ref'] ) ) {
		return '';
	}

	$reusable_block = get_post( $attributes['ref'] );
	if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) {
		return '';
	}

	if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {
		return '';
	}

	return do_blocks( $reusable_block->post_content );
}

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/render_block_core_block