Back to Main Site

Hook: post.content.render

Last updated on Jun 24, 2026 01:06

Overview

Type: Filter Location: app/Http/Resources/Api/V1/PostResource.php

Filters post HTML content before it is returned in API responses. Runs during resource serialization, allowing modules to inject or transform content dynamically.

Parameters

Param Type Description
$html string Rendered HTML content
$post Post Post model instance

Return

Must return string - modified HTML.

Usage Example

Append a copyright notice to every post:

Hook::addFilter('post.content.render', function (string $html, $post) {
    return $html . '<p class="text-sm text-gray-500">Copyright ' . date('Y') . ' PolyCMS</p>';
});

Related Hooks

content.render.html - Filter rendered block HTML

content.render.blocks - Filter block array before rendering


PolyCMS is an open-source content management system for modern web applications, inspired by the WordPress plugin and theme ecosystem but built on top of the Laravel framework. It is designed to provide a complete foundation for content publishing, e-commerce, multi-language support, and extensible module architecture — powered by a Vue 3 admin panel with data served entirely through RESTful APIs.

Whether you're building a blog, a documentation site, an online store, or a multi-tenant SaaS platform, PolyCMS aims to give you a comprehensive starting scaffold so you can ship quickly and extend easily through integrated modules and themes. In particular, themes in PolyCMS follow a multi-theme architecture — one Main theme and an unlimited number of Sub themes can run side by side on the same installation.

We hope this ready-made foundation proves useful for building your next website, blog, or web app, saving you from having to start completely from scratch.