Skip to content

Instantly share code, notes, and snippets.

View schlotterer's full-sized avatar
🏠
Working from home

Joel Schlotterer schlotterer

🏠
Working from home
View GitHub Profile
@schlotterer
schlotterer / acf-block-registration-example.php
Last active July 7, 2022 15:39
Sample block registration.
acf_register_block_type(array(
‘name’ => ‘custom-block’,
‘title’ => __(‘Custom Block’),
‘description’ => __(‘A custom block.’),
‘render_template’ => get_template_directory() . ‘/template-parts/blocks/custom-block/custom-block.php’,
// Basic style enqueue
'enqueue_style' => get_template_directory_uri() . '/template-parts/blocks/custom-block/custom-block.css',
// Basic Script enqueue
'enqueue_script' => get_template_directory_uri() . '/template-parts/blocks/custom-block/custom-block.js',