Last active
May 17, 2019 20:04
-
-
Save bph/c783cdff9fb14877326122e40938d3be to your computer and use it in GitHub Desktop.
Example Code for using ACF building blocks
This file contains hidden or 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
function register_acf_blocks() { | |
// register a team member block. | |
acf_register_block(array( | |
'name' => 'acf-team-member', | |
'title' => __('ACF Team Member'), | |
'description' => __('A custom team member block created via ACF 5.8'), | |
'render_template' => 'content-block-team-member.php', | |
'category' => 'formatting', | |
'icon' => 'admin-comments', | |
'keywords' => array( 'team member', 'team' ), | |
)); | |
} | |
// Check if function exists and hook into setup. | |
if( function_exists('acf_register_block') ) { | |
add_action('acf/init', 'register_acf_blocks'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment