✨feature: Scaffold contact info block
This commit is contained in:
27
views/blocks/contact-info/block.json
Normal file
27
views/blocks/contact-info/block.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "acf/contact-info",
|
||||||
|
"title": "Contact Info Block",
|
||||||
|
"description": "Show contact information with icons and optional form.",
|
||||||
|
"style": [
|
||||||
|
"file:./contact-info.css"
|
||||||
|
],
|
||||||
|
"category": "vdi-block",
|
||||||
|
"icon": "feedback",
|
||||||
|
"keywords": [
|
||||||
|
"contact info",
|
||||||
|
"contact form"
|
||||||
|
],
|
||||||
|
"acf": {
|
||||||
|
"mode": "auto",
|
||||||
|
"renderTemplate": "contact-info.php"
|
||||||
|
},
|
||||||
|
"supports": {
|
||||||
|
"align": true,
|
||||||
|
"anchor": true,
|
||||||
|
"color": false,
|
||||||
|
"html": false,
|
||||||
|
"jsx": true,
|
||||||
|
"mode": true,
|
||||||
|
"multiple": false
|
||||||
|
}
|
||||||
|
}
|
||||||
0
views/blocks/contact-info/contact-info.css
Normal file
0
views/blocks/contact-info/contact-info.css
Normal file
27
views/blocks/contact-info/contact-info.php
Normal file
27
views/blocks/contact-info/contact-info.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Block Name: Contact Info
|
||||||
|
*
|
||||||
|
* Display contact information from global fields with icons and optional form.
|
||||||
|
*
|
||||||
|
* @package BasicWP
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace BasicWP;
|
||||||
|
|
||||||
|
$classes = 'contact-info';
|
||||||
|
|
||||||
|
if ( ! $is_preview ) {
|
||||||
|
$wrapper = get_block_wrapper_attributes(
|
||||||
|
array(
|
||||||
|
'class' => $classes,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$wrapper = 'class="' . $classes . '"';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section <?php echo esc_attr( $wrapper ); ?>>
|
||||||
|
<!-- Your block code will go here -->
|
||||||
|
</section>
|
||||||
Reference in New Issue
Block a user