register_block_core_shortcode

The timeline below displays how wordpress function register_block_core_shortcode has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Registers the `core/shortcode` block on server.
 */
function register_block_core_shortcode()
{
    register_block_type_from_metadata(__DIR__ . '/shortcode', array('render_callback' => 'render_block_core_shortcode'));
}

WordPress Version: 5.4

/**
 * 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')));
}

WordPress Version: 5.3

/**
 * 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'));
}

WordPress Version: 5.0

/**
 * Registers the `core/shortcode` block on server.
 */
function register_block_core_shortcode()
{
    register_block_type('core/shortcode', array('render_callback' => 'render_block_core_shortcode'));
}