| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Template for displaying terms acceptance status. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
* |
| 7 |
* @package woo-additional-terms |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
defined( 'WC_VERSION' ) || exit; |
| 12 |
|
| 13 |
// Bailout, if no value found. |
| 14 |
if ( empty( $args['meta'] ) ) { |
| 15 |
return; |
| 16 |
} |
| 17 |
|
| 18 |
// This block is intended for ensuring backward compatibility with versions older than 1.6.0. |
| 19 |
// It's worth noting that in previous versions, the acceptance value was stored within an array. |
| 20 |
if ( is_array( $args['meta'] ) ) { |
| 21 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 22 |
$args['meta'] = 'yes'; |
| 23 |
} |
| 24 |
?> |
| 25 |
|
| 26 |
<?php /* incorrect CSS class added here, so it adopts styling we want. */ ?> |
| 27 |
<div class="address"> |
| 28 |
<p> |
| 29 |
<strong style="display:flex;gap:5px;"> |
| 30 |
<?php esc_html_e( 'Additional terms and conditions:', 'woo-additional-terms' ); ?> |
| 31 |
<span class="status-<?php echo esc_attr( wc_string_to_bool( $args['meta'] ) ? 'enabled' : 'disabled' ); ?>"></span> |
| 32 |
</strong> |
| 33 |
</p> |
| 34 |
</div> |
| 35 |
|
| 36 |
<?php |
| 37 |
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */ |
| 38 |
|