Helper::build_class( [ [ "has-custom-width wp-block-acf-field-blocks-acf-button__width-" . ( $attr['width'] ?? '' ), ( isset( $attr['width'] ) && ! empty( $attr['width'] ) ) ], [ "has-text-align-" . $attr['buttonAlign'], isset( $attr['buttonAlign'] ) && ! empty( $attr['buttonAlign'] ) ] ] ) ]); $color = Helper::get_color_class_and_style( $attr ); $border = Helper::get_border_class_and_style( $attr ); $spacing = Helper::get_spacing_class_and_style( $attr ); // $shadow = Helper::get_shadow_class_and_style( $attr ); $typography = Helper::get_typography_class_and_style( $attr ); $button_class = Helper::build_class( [ 'wp-block-acf-field-blocks-acf-button__link', 'wp-element-button', [ "has-text-align-" . ( $attr['textAlign'] ?? '' ), ( isset( $attr['textAlign'] ) && ! empty( $attr['textAlign'] ) ) ], $color['class'] ?? '', $border['class'] ?? '', $spacing['class'] ?? '', // $shadow['class'] ?? '', $typography['class'] ?? '' ] ); $button_styles = [ $color['style'] ?? '', $border['style'] ?? '', $spacing['style'] ?? '', // $shadow['style'] ?? '', $typography['style'] ?? '' ]; $button_style = implode( '', $button_styles ); $rel = ''; if ( isset( $attr['linkTarget'] ) && '_blank' === $attr['linkTarget'] ) { $rel .= "noreferrer noopener "; } if ( isset( $attr['nofollow'] ) && $attr['nofollow'] ) { $rel .= "nofollow "; } $button_attributes = Helper::build_attrs([ 'href' => esc_url( $url ), 'class' => esc_attr( $button_class ), 'style' => esc_attr( $button_style ), 'target' => esc_attr( $attr['linkTarget'] ), 'rel' => esc_attr( $rel ), 'download' => isset( $attr['asDownload'] ) && $attr['asDownload'] ]); ob_start(); ?>