Advertisement
Guest User

Untitled

a guest
Oct 30th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. if ( empty( $attributes['data'] ) ) {
  3.     return;
  4. }
  5.  
  6. $id = 'testimonial-' . ( $attributes['id'] ?? '' );
  7.  
  8. $buttons = mb_get_block_field( 'btn_group' );
  9. foreach ( $buttons as $button ) {
  10.     $text          = $button['btn_txt'] ?? 'Click me';
  11.     $url           = $button['btn_url'] ?? '#';
  12.     $stacked       = $button['btn_stacked'] ?? false;
  13.     $stacked_style = $stacked ? 'stacked' : '';
  14.     $style         = $button['btn_style'] ?? 'standard';
  15.  
  16.     echo "<a href='$url' class='$stacked $style'>$text</a>";
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement