Initial commit to github

This commit is contained in:
Keith Solomon
2025-08-22 15:40:01 -05:00
commit e8efdbeb34
230 changed files with 32213 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
{
"name": "acf/grid-cell",
"title": "Grid Cell (VDI)",
"description": "Custom grid cell block.",
"style": [
"file:./grid-cell.css"
],
"category": "vdi-block",
"icon": "grid-view",
"keywords": [
"grid"
],
"acf": {
"mode": "preview",
"renderTemplate": "grid-cell.php"
},
"supports": {
"align": false,
"anchor": false,
"color": true,
"html": false,
"jsx": true,
"mode": true,
"multiple": true
},
"parent": [ "acf/grid" ]
}

View File

View File

@@ -0,0 +1,48 @@
<?php
/**
* Block Name: Grid Cell
*
* This is the template that displays the Grid Cell block.
*
* @package BasicWP
*/
namespace BasicWP;
// Initialize variables
$className = ! empty( $block['className'] ) ? $block['className'] : '';
$span = get_field( 'col_span' );
$spanBPs = get_field( 'col_span_breakpoints' );
$className .= $className . ' grid-cell px-4 py-2';
$gridClasses = '';
// Add column span classes
if ( $span && $span !== 'auto' ) {
$gridClasses .= ' col-span-' . $span;
}
// Add breakpoint-specific column span classes
if ( $spanBPs ) {
foreach ( $spanBPs as $bp ) {
$gridClasses .= ' ' . $bp . ':col-span-' . get_field( 'col_span_' . $bp );
}
}
// Combine all classes
$className .= ' ' . trim( $gridClasses );
if ( ! $is_preview ) {
$wrapper = get_block_wrapper_attributes(
array( 'class' => trim( $className ) )
);
} else {
$wrapper = '';
}
?>
<div <?php echo wp_kses_post( $wrapper ); ?>>
<InnerBlocks className="" />
</div>