| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 3 |
|
| 4 |
$html_atts = ''; |
| 5 |
|
| 6 |
if ( empty( $data['atts'] ) ) { |
| 7 |
$data['atts'] = []; |
| 8 |
} |
| 9 |
|
| 10 |
if ( ! isset( $data['atts']['class'] ) ) { |
| 11 |
// Class used for JS. |
| 12 |
$data['atts']['class'] = 'button-primary button-imagify-optimize'; |
| 13 |
} |
| 14 |
|
| 15 |
if ( ! isset( $data['atts']['data-processing-label'] ) ) { |
| 16 |
// Used for JS. |
| 17 |
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' ); |
| 18 |
} |
| 19 |
|
| 20 |
$html_atts = $this->build_attributes( $data['atts'] ); |
| 21 |
?> |
| 22 |
|
| 23 |
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>> |
| 24 |
<?php esc_html_e( 'Optimize', 'imagify' ); ?> |
| 25 |
</a> |
| 26 |
|
| 27 |
<?php |
| 28 |
if ( ! empty( $data['atts']['data-processing-label'] ) ) { |
| 29 |
$this->print_js_template_in_footer( 'button/processing' ); |
| 30 |
} |
| 31 |
|