Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active June 9, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/7960927d3835ef3d2fa128c6b86dc3e5 to your computer and use it in GitHub Desktop.
Save billerickson/7960927d3835ef3d2fa128c6b86dc3e5 to your computer and use it in GitHub Desktop.
<?php
/**
* Register Blocks
* @see https://www.billerickson.net/building-gutenberg-block-acf/#register-block
*
*/
function be_register_blocks() {
if( ! function_exists( 'acf_register_block_type' ) )
return;
acf_register_block_type( array(
'name' => 'team-member',
'title' => __( 'Team Member', 'clientname' ),
'render_template' => 'partials/block-team-member.php',
'category' => 'formatting',
'icon' => 'admin-users',
'mode' => 'auto',
'keywords' => array( 'profile', 'user', 'author' )
));
}
add_action('acf/init', 'be_register_blocks' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment