Skip to content

Instantly share code, notes, and snippets.

@clarklab
Created January 27, 2020 18:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarklab/4e2c0f792f8a965b83aa2f2bed24bac0 to your computer and use it in GitHub Desktop.
Save clarklab/4e2c0f792f8a965b83aa2f2bed24bac0 to your computer and use it in GitHub Desktop.
WordPress Gutenberg block use only once
<?php
// ... the rest of your file here
acf_register_block_type(array(
'name' => 'hero',
'title' => __('Hero'),
'description' => __('A custom hero block.'),
'render_template' => 'template-parts/blocks/hero/hero.php',
'category' => 'formatting',
'supports' => array( 'align' => false, 'multiple' => false ),
));
// ... the rest of your file here
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment