| @@ -1,10 +1,33 @@ | ||
| 1 | -<button class="acym_vcenter align-center acy_button_submit cell medium-6 large-shrink button <?php echo $data['isPrimary'] ? '' | |
| 2 | - : 'button-secondary'; ?>" <?php echo acym_getFormattedAttributes($data['attributes']); ?>> | |
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | +?> | |
| 5 | +<button class="acym_vcenter align-center acy_button_submit cell medium-6 large-shrink button <?php echo $data['isPrimary'] ? '' : 'button-secondary'; ?>" | |
| 3 | 6 | <?php |
| 7 | + foreach ($data['attributes'] as $oneAttribute => $oneValue) { | |
| 8 | + if (is_array($oneValue) || is_object($oneValue)) { | |
| 9 | + $oneValue = json_encode($oneValue); | |
| 10 | + } elseif ($oneValue === true) { | |
| 11 | + $oneValue = $oneAttribute; | |
| 12 | + } | |
| 13 | + | |
| 14 | + echo ' '.esc_attr($oneAttribute).'="'.esc_attr($oneValue).'"'; | |
| 15 | + } | |
| 16 | + ?> | |
| 17 | +> | |
| 18 | + <?php | |
| 4 | 19 | if (!empty($data['icon'])) { |
| 5 | - echo '<i class="acymicon-'.$icon.'"></i>'; | |
| 20 | + echo '<i class="acymicon-'.esc_attr($data['icon']).'"></i>'; | |
| 6 | 21 | } |
| 7 | 22 | |
| 8 | - echo ' '.$data['content']; | |
| 23 | + echo ' '.wp_kses( | |
| 24 | + $data['content'], | |
| 25 | + [ | |
| 26 | + 'span' => [ | |
| 27 | + 'id' => true, | |
| 28 | + 'data-default' => true, | |
| 29 | + ], | |
| 30 | + ] | |
| 31 | + ); | |
| 9 | 32 | ?> |
| 10 | 33 | </button> |