Skip to content

Instantly share code, notes, and snippets.

Jure Cuhalev gandalfar

Block or report user

Report or block gandalfar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gandalfar / register-block-testimonial.php
Last active Jan 4, 2019 — forked from nicooprat/custom-callback.php
Create an ACF block with Sage 9 & Blade
View register-block-testimonial.php
add_action('acf/init', function() {
if( function_exists('acf_register_block') ) {
// Look into views/blocks
$dir = new \DirectoryIterator(\locate_template("views/blocks/"));
// Loop through found blocks
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
$slug = str_replace('.blade.php', '', $fileinfo->getFilename());
// Get infos from file
$file_path = \locate_template("views/blocks/${slug}.blade.php");
You can’t perform that action at this time.