| 1 |
<?php |
| 2 |
/** |
| 3 |
* Server-side rendering of the `gutenify/social` block. |
| 4 |
* |
| 5 |
* @package Gutenify |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Registers the block on server. |
| 10 |
*/ |
| 11 |
function gutenify_register_team_block() { |
| 12 |
// Return early if this function does not exist. |
| 13 |
if ( ! function_exists( 'register_block_type' ) ) { |
| 14 |
return; |
| 15 |
} |
| 16 |
|
| 17 |
// Load attributes from block.json. |
| 18 |
ob_start(); |
| 19 |
include GUTENIFY_PLUGIN_DIR . 'src/blocks/team/block.json'; |
| 20 |
$metadata = json_decode( ob_get_clean(), true ); |
| 21 |
|
| 22 |
register_block_type( |
| 23 |
'gutenify/team', |
| 24 |
array( |
| 25 |
'editor_script' => 'gutenify-editor', |
| 26 |
'editor_style' => 'gutenify-editor', |
| 27 |
'style' => 'gutenify-frontend', |
| 28 |
) |
| 29 |
); |
| 30 |
} |
| 31 |
add_action( 'init', 'gutenify_register_team_block' ); |
| 32 |
|