Hook: content.render.blocks

Last updated on May 21, 2026 05:05

Overview

Type: Filter Location: app/Services/ContentRenderer.php

Filters parsed block array before rendering to HTML. Use to add, remove, or reorder blocks programmatically.

Parameters

Param Type Description
$blocks array Array of parsed content blocks

Return

Must return array.

Usage Example

Hook::addFilter('content.render.blocks', function (array $blocks) {
    if (request()->is('amp/*')) {
        return array_filter($blocks, fn($b) => ($b['type'] ?? '') !== 'image');
    }
    return $blocks;
});