Initial commit to github
This commit is contained in:
24
views/blocks/buttons/block.json
Normal file
24
views/blocks/buttons/block.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "acf/buttons",
|
||||
"title": "Buttons (VDI)",
|
||||
"description": "A button or group of buttons.",
|
||||
"allowedBlocks": [ "acf/button" ],
|
||||
"category": "vdi-block",
|
||||
"icon": "button",
|
||||
"keywords": [
|
||||
"buttons"
|
||||
],
|
||||
"acf": {
|
||||
"mode": "preview",
|
||||
"renderTemplate": "buttons.php"
|
||||
},
|
||||
"supports": {
|
||||
"align": false,
|
||||
"anchor": true,
|
||||
"color": false,
|
||||
"html": true,
|
||||
"jsx": true,
|
||||
"mode": false,
|
||||
"multiple": true
|
||||
}
|
||||
}
|
||||
27
views/blocks/buttons/buttons.php
Normal file
27
views/blocks/buttons/buttons.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Block Name: Buttons
|
||||
*
|
||||
* This is the template that renders the Buttons block.
|
||||
*
|
||||
* @package BasicWP
|
||||
*/
|
||||
|
||||
namespace BasicWP;
|
||||
|
||||
$ibClasses = 'flex flex-wrap gap-4 w-full justify-center sm:justify-start';
|
||||
|
||||
$classes = 'align-with-content my-[1.2em]';
|
||||
|
||||
if ( ! $is_preview ) {
|
||||
$wrapper = get_block_wrapper_attributes(
|
||||
array( 'class' => $classes )
|
||||
);
|
||||
} else {
|
||||
$wrapper = 'class="' . $classes . '"';
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="<?php echo esc_attr( $block['id'] ); ?>" <?php echo esc_attr( $wrapper ); ?>>
|
||||
<InnerBlocks className="<?php echo esc_attr( $ibClasses ); ?>" />
|
||||
</div>
|
||||
Reference in New Issue
Block a user