FEATURE Introducing block custom vidéo
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
43d1c2418d
commit
699a2efe1b
25
plugins/carhop-blocks/acf-blocks/custom-video/block.json
Normal file
25
plugins/carhop-blocks/acf-blocks/custom-video/block.json
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"name": "acf/custom-video",
|
||||||
|
"title": "Vidéo Auto-hébergée",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"multiple": true,
|
||||||
|
"icon": {
|
||||||
|
"foreground": "#136f63",
|
||||||
|
"src": "format-video"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"vidéo",
|
||||||
|
"video",
|
||||||
|
"auto-hébergée"
|
||||||
|
],
|
||||||
|
"supports": {
|
||||||
|
"align": [
|
||||||
|
"full"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"acf": {
|
||||||
|
"mode": "auto",
|
||||||
|
"renderTemplate": "custom-video.php"
|
||||||
|
},
|
||||||
|
"align": "full"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
$custom_video_id = get_field('custom_video_id');
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section class="block-custom-video custom-video content-section">
|
||||||
|
<div style="position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden;">
|
||||||
|
<iframe id="ik-vod-<?php echo $custom_video_id; ?>" class="ik-player-1jhvl2upwockr ik-embed" src="https://player.vod2.infomaniak.com/embed/<?php echo $custom_video_id; ?>" width="100%" height="100%" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0" allowfullscreen crossorigin="anonymous" frameborder="0" allow="autoplay; fullscreen; picture-in-picture"></iframe>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -56,6 +56,7 @@ function carhop_register_blocks()
|
||||||
|
|
||||||
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
||||||
register_block_type(__DIR__ . '/acf-blocks/social-networks');
|
register_block_type(__DIR__ . '/acf-blocks/social-networks');
|
||||||
|
register_block_type(__DIR__ . '/acf-blocks/custom-video');
|
||||||
|
|
||||||
// Enregistrer le script pour le bloc gallery
|
// Enregistrer le script pour le bloc gallery
|
||||||
wp_register_script(
|
wp_register_script(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user