From 6eac68833bb12477b40086d831421c589b4cfc27 Mon Sep 17 00:00:00 2001 From: "Michael W. Delaney" Date: Mon, 11 Feb 2019 16:50:15 -0500 Subject: [PATCH] Fix namespace in callback, closes #1 --- sage-acf-gutenberg-blocks.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sage-acf-gutenberg-blocks.php b/sage-acf-gutenberg-blocks.php index 59a04db..d42d9cf 100644 --- a/sage-acf-gutenberg-blocks.php +++ b/sage-acf-gutenberg-blocks.php @@ -55,12 +55,12 @@ function sage_blocks_callback($block) // Get header info from the found template file(s) $file_path = locate_template("views/blocks/${slug}.blade.php"); $file_headers = get_file_data($file_path, [ - 'title' => 'Title', - 'description' => 'Description', - 'category' => 'Category', - 'icon' => 'Icon', - 'keywords' => 'Keywords', - ]); + 'title' => 'Title', + 'description' => 'Description', + 'category' => 'Category', + 'icon' => 'Icon', + 'keywords' => 'Keywords', + ]); if (empty($file_headers['title'])) { $sage_error(__('This block needs a title: ' . $template_directory . $fileinfo->getFilename(), 'sage'), __('Block title missing', 'sage')); @@ -78,7 +78,7 @@ function sage_blocks_callback($block) 'category' => $file_headers['category'], 'icon' => $file_headers['icon'], 'keywords' => explode(' ', $file_headers['keywords']), - 'render_callback' => 'sage_blocks_callback', + 'render_callback' => __NAMESPACE__.'\\sage_blocks_callback', ]; // Register the block with ACF