This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds Gutenberg Blocks with ACF. | |
* | |
* @return void | |
*/ | |
function wds_register_acf_gutenberg_blocks() { | |
if ( function_exists( 'acf_register_block' ) ) { | |
// Register the hero block. | |
acf_register_block(array( | |
'name' => 'hero', | |
'title' => __( 'Hero', 'wds' ), | |
'description' => __( 'A hero block.', 'wds' ), | |
'render_template' => get_template_directory() . '/template-parts/gutenberg/hero.php', | |
'category' => 'layout', | |
'icon' => 'slides', | |
'mode' => 'preview', | |
'keywords' => array( 'hero', 'slider' ), | |
)); | |
} | |
} | |
add_action( 'acf/init', 'wds_register_acf_gutenberg_blocks' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment