CoreFiles by mySites.guru
shortcode.php36 lines, 824 bytes, from wordpress-5.4.21.zip
Raw History Compare with 5.4.20
md5
0ea533a8839103845dc2d636993e19eb
sha1
15c920d0445c911f816770925c8abf9be94e3034
sha256
793af9692e2960529856d1679d7a28bf0e4bc0ede8846ec54dab66f669d1a1d2
<?php
/**
 * Server-side rendering of the `core/shortcode` block.
 *
 * @package WordPress
 */

/**
 * Performs wpautop() on the shortcode block content.
 *
 * @param array  $attributes The block attributes.
 * @param string $content    The block content.
 *
 * @return string Returns the block content.
 */
function render_block_core_shortcode( $attributes, $content ) {
	return wpautop( $content );
}

/**
 * Registers the `core/shortcode` block on server.
 */
function register_block_core_shortcode() {
	$path     = __DIR__ . '/shortcode/block.json';
	$metadata = json_decode( file_get_contents( $path ), true );
	register_block_type(
		$metadata['name'],
		array_merge(
			$metadata,
			array(
				'render_callback' => 'render_block_core_shortcode',
			)
		)
	);
}
add_action( 'init', 'register_block_core_shortcode' );

The same content is in 37 releases, WordPress 5.4-beta1 to 5.4.25. See them all, or every version of this file.