introducing the custom blocks
This commit is contained in:
parent
1a03d63810
commit
0a3f5d833b
43
includes/blocks.php
Normal file
43
includes/blocks.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Plugin Name: Homegrade Blocks
|
||||
* Description: Un série de Blocks sur mesure pour l'écriture du contenu Homegrade
|
||||
* Author: Deligraph
|
||||
* Text Domain: homegrade-blocks
|
||||
*/
|
||||
|
||||
/* ---------------------------
|
||||
BLOCK CATEGORY
|
||||
---------------------------*/
|
||||
|
||||
|
||||
function metiers_patrimoine_add_block_categories($categories)
|
||||
{
|
||||
return array_merge(
|
||||
|
||||
[
|
||||
[
|
||||
'slug' => 'metiers-patrimoine-blocks',
|
||||
'title' => __('Blocs Métiers du patrimoine ', 'metiers-patrimoine-blocks'),
|
||||
// the icon is modified in the editor.js adjustement file
|
||||
],
|
||||
],
|
||||
$categories
|
||||
);
|
||||
}
|
||||
add_action('block_categories_all', 'metiers_patrimoine_add_block_categories', 25, 2);
|
||||
|
||||
|
||||
/* ---------------------------
|
||||
REGISTER BLOCKS
|
||||
---------------------------*/
|
||||
function metiers_patrimoine_create_blocks_init()
|
||||
{
|
||||
|
||||
|
||||
// ACF
|
||||
// register_block_type(dirname(__DIR__) . '/blocks/btn-search-artisan');
|
||||
register_block_type(dirname(__DIR__) . '/blocks/search-artisan-btn');
|
||||
}
|
||||
add_action('init', 'metiers_patrimoine_create_blocks_init');
|
||||
Loading…
Reference in New Issue
Block a user