This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Block Name: Pull Quote
|
||||
*
|
||||
* A decorative pull quote with background vectors and accent border.
|
||||
*
|
||||
* @package CWC
|
||||
*/
|
||||
|
||||
namespace CWC;
|
||||
|
||||
$quote_bg = get_field( 'quote_bg' );
|
||||
$quote_bgColor = get_field( 'quote_bg_color' );
|
||||
$quote_text = get_field( 'quote_text' );
|
||||
|
||||
if ( empty( $quote_text ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $quote_bgColor ) {
|
||||
$quote_bgColor = 'bg-[' . esc_attr( $quote_bgColor ) . '] ';
|
||||
} else {
|
||||
$quote_bgColor = 'bg-(--color-pullquote-bg) ';
|
||||
}
|
||||
|
||||
$classes = $quote_bgColor . 'pull-quote mx-break-out';
|
||||
$wrapper = blockWrapperAttributes( $classes, $is_preview );
|
||||
?>
|
||||
|
||||
<section <?php echo wp_kses_post( $wrapper ); ?>>
|
||||
<?php if ( $quote_bg ) : ?>
|
||||
<div class="pull-quote__vector" aria-hidden="true">
|
||||
<img class="pull-quote__vector--bg" src="<?php echo esc_url( $quote_bg['url'] ); ?>" alt="" loading="lazy" role="presentation" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="container pull-quote__content">
|
||||
<div class="pull-quote__text container">
|
||||
<?php echo wp_kses_post( $quote_text ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user