function gutenberg_render_block_core_block in Gutenberg 8.2
Same name and namespace in other branches
- 8 vendor/gutenberg/block-library/blocks/block.php \gutenberg_render_block_core_block()
Renders the `core/block` block on server.
Parameters
array $attributes The block attributes.:
Return value
string Rendered HTML of the referenced block.
1 string reference to 'gutenberg_render_block_core_block'
- gutenberg_register_block_core_block in vendor/
gutenberg/ block-library/ blocks/ block.php - Registers the `core/block` block.
File
- vendor/
gutenberg/ block-library/ blocks/ block.php, line 15
Code
function gutenberg_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);
}