register_block_core_gallery

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

WordPress Version: 6.1

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

WordPress Version: 5.9

/**
 * Registers the `core/gallery` block on server.
 * This render callback needs to be here
 * so that the gallery styles are loaded in block-based themes.
 */
function register_block_core_gallery()
{
    register_block_type_from_metadata(__DIR__ . '/gallery', array('render_callback' => function ($attributes, $content) {
        return $content;
    }));
}