Skip to content

Commit

Permalink
Fix namespace in callback, closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
MWDelaney authored Feb 11, 2019
1 parent 1b8d559 commit 6eac688
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sage-acf-gutenberg-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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
Expand Down

0 comments on commit 6eac688

Please # to comment.