Skip to content

Instantly share code, notes, and snippets.

@NielsPilon NielsPilon/functions.php
Last active Nov 29, 2018

What would you like to do?
ACF Gutenberg block render callback
function my_acf_block_render_callback( $block ) {
// convert name ("acf/testimonial") into path friendly slug ("testimonial")
$slug = str_replace('acf/', '', $block['name']);
// template bestand vanuit de "template-parts/block" map includen
if( file_exists(STYLESHEETPATH . "/blocks/content-{$slug}.php") ) {
include( STYLESHEETPATH . "/blocks/content-{$slug}.php" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.