render_block_core_pattern()WP 1.0

Renders the core/pattern block on the server.

Хуков нет.

Возвращает

Строку. Returns the output of the pattern.

Использование

render_block_core_pattern( $attributes );
$attributes(массив) (обязательный)
Block attributes.

Код render_block_core_pattern() WP 6.0.2

function render_block_core_pattern( $attributes ) {
	if ( empty( $attributes['slug'] ) ) {
		return '';
	}

	$slug     = $attributes['slug'];
	$registry = WP_Block_Patterns_Registry::get_instance();
	if ( ! $registry->is_registered( $slug ) ) {
		return '';
	}

	$pattern = $registry->get_registered( $slug );
	return do_blocks( $pattern['content'] );
}