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,51 @@
<?php
/**
* Button block
*
* @package BasicWP
*/
namespace BasicWP;
// Retrieve ACF fields
$element = get_field( 'element' ) ? get_field( 'element' ) : 'a';
$btnLink = get_field( 'link' );
$url = $btnLink['url'] ? $btnLink['url'] : '';
$target = $btnLink['target'] ? $btnLink['target'] : '';
$btnTitle = $btnLink['title'] ? $btnLink['title'] : 'Button';
$color = get_field( 'color' );
$variant = get_field( 'variant' );
$size = get_field( 'size' );
$width = get_field( 'width' );
// Handle admin preview
if ( is_admin() && $url ) {
$url = '#';
}
// Set wrapper classes
$classes = 'button text-center';
if ( ! $is_preview ) {
$wrapper = get_block_wrapper_attributes(
array( 'class' => $classes )
);
$wrapper = str_replace( 'class="', '', $wrapper );
$wrapper = str_replace( '"', '', $wrapper );
} else {
$wrapper = $classes;
}
?>
<x-button
btnClasses="<?php echo esc_attr( $wrapper ); ?>"
element="<?php echo esc_attr( $element ); ?>"
url="<?php echo esc_url( $url ); ?>"
target="<?php echo esc_attr( $target ); ?>"
title="<?php echo esc_attr( $btnTitle ); ?>"
color="<?php echo esc_attr( $color ); ?>"
variant="<?php echo esc_attr( $variant ); ?>"
size="<?php echo esc_attr( $size ); ?>"
width="<?php echo esc_attr( $width ); ?>"
></x-button>