FEATURE Introducing the block

This commit is contained in:
Antoine M 2026-03-03 17:10:24 +01:00
parent c99d92423c
commit a3e1a8121b
3 changed files with 28 additions and 18 deletions

View 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"
}
}

View File

@ -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));

View File

@ -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
------------------------------------------------------------------*/