context['postId'] ) ) {
return '';
}
if ( ! in_the_loop() ) {
the_post();
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) );
return (
'
' .
apply_filters( 'the_content', str_replace( ']]>', ']]>', get_the_content( null, false, $block->context['postId'] ) ) ) .
'
'
);
}
/**
* Registers the `core/post-content` block on the server.
*/
function gutenberg_register_block_core_post_content() {
register_block_type_from_metadata(
__DIR__ . '/post-content',
array(
'render_callback' => 'gutenberg_render_block_core_post_content',
)
);
}
add_action( 'init', 'gutenberg_register_block_core_post_content', 20 );