FEATURE Introducing the block
This commit is contained in:
parent
c99d92423c
commit
a3e1a8121b
21
plugins/carhop-blocks/acf-blocks/member-card/block.json
Normal file
21
plugins/carhop-blocks/acf-blocks/member-card/block.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "acf/member-card",
|
||||
"title": "Membre Carhop",
|
||||
"category": "carhop-blocks",
|
||||
"multiple": true,
|
||||
"icon": {
|
||||
"foreground": "#136f63",
|
||||
"src": "universal-access-alt"
|
||||
},
|
||||
"keywords": [
|
||||
"membre",
|
||||
"contact",
|
||||
"personne",
|
||||
"personne de contact"
|
||||
],
|
||||
"supports": {},
|
||||
"acf": {
|
||||
"mode": "auto",
|
||||
"renderTemplate": "member-card.php"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
$member_id = get_field('member_id');
|
||||
|
||||
get_template_part('template-parts/components/cards/member-contact-card', '', array('member_id' => $member_id));
|
||||
|
|
@ -27,16 +27,7 @@ function create_block_carhop_blocks_block_init()
|
|||
register_block_type(__DIR__ . '/acf-blocks/social-networks');
|
||||
register_block_type(__DIR__ . '/acf-blocks/custom-video');
|
||||
register_block_type(__DIR__ . '/acf-blocks/team-carhop');
|
||||
|
||||
|
||||
// if (function_exists('wp_register_block_types_from_metadata_collection')) {
|
||||
// wp_register_block_types_from_metadata_collection(__DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (function_exists('wp_register_block_metadata_collection')) {
|
||||
// wp_register_block_metadata_collection(__DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php');
|
||||
// }
|
||||
register_block_type(__DIR__ . '/acf-blocks/member-card');
|
||||
|
||||
$manifest_data = require __DIR__ . '/build/blocks-manifest.php';
|
||||
foreach (array_keys($manifest_data) as $block_type) {
|
||||
|
|
@ -63,17 +54,9 @@ function carhop_add_block_categories($categories)
|
|||
}
|
||||
add_action('block_categories_all', 'carhop_add_block_categories', 25, 2);
|
||||
|
||||
|
||||
##### CUSTOM BLOCKS SETTINGS #####
|
||||
require_once __DIR__ . '/src/audio-player/audio-player.php';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
##### ENQUEUE BLOCKS
|
||||
------------------------------------------------------------------*/
|
||||
|
|
@ -101,6 +84,7 @@ function carhop_register_blocks()
|
|||
}
|
||||
add_action('init', 'carhop_register_blocks');
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
##### EDITOR EXTENSIONS
|
||||
------------------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user