Skip to content

Commit

Permalink
Merge pull request #147 from salcode/sf/function-exists-146
Browse files Browse the repository at this point in the history
Add function_exists() check to block PHP template
  • Loading branch information
schlessera authored May 8, 2018
2 parents fcf280b + a7441a6 commit 302dfc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/block-php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* @see https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
*/
function {{machine_name}}_block_init() {
// Skip block registration if Gutenberg is not enabled/merged.
if ( ! function_exists( 'register_block_type' ) ) {
return;
}
{{#plugin}}
$dir = dirname( __FILE__ );
{{/plugin}}
Expand Down

0 comments on commit 302dfc9

Please sign in to comment.