Skip to content

Instantly share code, notes, and snippets.

View paolo-cargnin's full-sized avatar

Paolo Cargnin paolo-cargnin

View GitHub Profile
@marijoo
marijoo / helpers.php
Last active January 4, 2024 17:23
Render ACF blocks with Sage and blade templates
<?php
// add this function to Sage’s app/helpers.php
// inspired by nicooprat: https://gist.github.com/nicooprat/2c1a642d102425d3131037e5dc156361
/**
* Render callback for ACF $blocks
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.