CoreFiles by mySites.guru
shortcode.php37 lines, 794 bytes, from wordpress-5.3.zip
Raw History Compare with 5.2.30
md5
893990c176e215a84a768ce9c4b197a4
sha1
1b635a58b1ec709f2d38d48e9f6cb2a19c57382f
sha256
e944ec72df5473001ca12038da27c53f94c76b19581b707793c99343510e4aff
<?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() {
	register_block_type(
		'core/shortcode',
		array(
			'attributes'      => array(
				'text' => array(
					'type'   => 'string',
					'source' => 'html',
				),
			),
			'render_callback' => 'render_block_core_shortcode',
		)
	);
}
add_action( 'init', 'register_block_core_shortcode' );

The same content is in 39 releases, WordPress 5.3-beta1 to 5.3.27. See them all, or every version of this file.