# gutenberg/7.4.0/build/block-library/blocks/post-content.php

Gutenberg, version 7.4.0. 37 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/7.4.0/code/build/block-library/blocks/post-content.php
- Raw: https://pluginprobe.com/plugins/gutenberg/7.4.0/raw/build/block-library/blocks/post-content.php
- Modified: 2019-11-27T13:22:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/7.4.0/code/build/block-library/blocks/post-content.php#L10-L20`.

```php
<?php
/**
 * Server-side rendering of the `core/post-content` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/post-content` block on the server.
 *
 * @return string Returns the filtered post content of the current post.
 */
function gutenberg_render_block_core_post_content() {
	$post = gutenberg_get_post_from_context();
	if ( ! $post ) {
		return '';
	}
	return (
		'<div class="entry-content">' .
			apply_filters( 'the_content', str_replace( ']]>', ']]&gt;', get_the_content( $post ) ) ) .
		'</div>'
	);
}

/**
 * Registers the `core/post-content` block on the server.
 */
function gutenberg_register_block_core_post_content() {
	register_block_type(
		'core/post-content',
		array(
			'render_callback' => 'gutenberg_render_block_core_post_content',
		)
	);
}
add_action( 'init', 'gutenberg_register_block_core_post_content', 20 );

```
