Files
Portfolio-2026/views/blocks/button/button.php
T
Keith SolomonandClaude Opus 4.7 e2f6270717 Release as SoloFrame Evo (#2)
* docs: Add onboarding documentation for new developers

Add four comprehensive guides to help new developers get started
with the VDI-Starter-v5 WordPress theme:

- docs/getting-started.md: Setup from zero, local WordPress options,
  env config, theme activation warnings, troubleshooting
- docs/architecture.md: Bootstrap flow, 7 architectural layers,
  namespace conventions, WP hooks cleanup, enqueue system, theme.json
- docs/creating-blocks.md: Step-by-step ACF block creation tutorial,
  helper functions, parent-child patterns, Tailwind integration
- docs/reference.md: Hooks/filters tables, design tokens, CSS import
  tree, JS module graph, class reference, CLI commands, deployment

Update README.md: trim deep-dive API docs (moved to reference),
add documentation links section, fix CSS paths (views/styles/ →
styles/), add missing contact-info block, fix deployment filename
typo (wpengine,yml → wpengine.yml), add backToTop.js and
enqEditorAssets(), add namespace conventions table.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: language graph

* docs: Update readme

* 🔵 other: Rename project and publish

* 🔵 other: Update .gitignore
2026-07-29 15:52:21 -05:00

54 lines
1.4 KiB
PHP

<?php
/**
* Button block
*
* @package SoloFrameEvo
*/
namespace SoloFrameEvo;
// Retrieve ACF fields
$element = get_field( 'element' ) ? get_field( 'element' ) : 'a';
$btnLink = get_field( 'link' );
$url = isset( $btnLink['url'] ) ? $btnLink['url'] : '';
$target = isset( $btnLink['target'] ) ? $btnLink['target'] : '';
$btnTitle = isset( $btnLink['title'] ) ? $btnLink['title'] : 'Button';
$btnAria = get_field( 'aria_label' ) ? get_field( 'aria_label' ) : '';
$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 ); ?>"
ariaLabel="<?php echo esc_attr( $btnAria ); ?>"
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>