render_block_core_block( array $attributes )

Renders the core/block block on server.


Description Description


Parameters Parameters

$attributes

(array) (Required) The block attributes.


Top ↑

Return Return

(string) Rendered HTML of the referenced block.


Top ↑

Source 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 );
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.