| @@ -1,33 +1,39 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 3 | +// Exit if accessed directly. | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | + | |
| 2 | 8 | /** |
| 3 | 9 | * Display radio field. |
| 4 | 10 | * |
| 5 | - * @author Eric Daams | |
| 11 | + * @author David Bisset | |
| 6 | 12 | * @package Charitable/Admin View/Settings |
| 7 | - * @copyright Copyright (c) 2019, Studio 164a | |
| 13 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 14 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 15 | * @since 1.0.0 |
| 10 | - * @version 1.6.7 | |
| 16 | + * @version 1.8.8.6 | |
| 11 | 17 | */ |
| 12 | 18 | |
| 13 | -$default = array_key_exists( 'default', $view_args ) ? $view_args['default'] : false; | |
| 14 | -$value = charitable_get_option( $view_args['key'], $default ); | |
| 19 | +$charitable_default = array_key_exists( 'default', $view_args ) ? $view_args['default'] : false; | |
| 20 | +$charitable_value = charitable_get_option( $view_args['key'], $charitable_default ); | |
| 15 | 21 | |
| 16 | 22 | ?> |
| 17 | 23 | <ul class="charitable-radio-list <?php echo esc_attr( $view_args['classes'] ); ?>"> |
| 18 | - <?php foreach ( $view_args['options'] as $option => $label ) : ?> | |
| 24 | + <?php foreach ( $view_args['options'] as $charitable_option => $charitable_label ) : ?> | |
| 19 | 25 | <li><input type="radio" |
| 20 | - id="<?php printf( 'charitable_settings_%s_%s', implode( '_', $view_args['key'] ), $option ); ?>" | |
| 21 | - name="<?php printf( 'charitable_settings[%s]', $view_args['name'] ); ?>" | |
| 22 | - value="<?php echo esc_attr( $option ); ?>" | |
| 23 | - <?php checked( $value, $option ); ?> | |
| 24 | - <?php echo charitable_get_arbitrary_attributes( $view_args ); ?> | |
| 26 | + id="<?php printf( 'charitable_settings_%s_%s', esc_attr( implode( '_', $view_args['key'] ) ), esc_attr( $charitable_option ) ); ?>" | |
| 27 | + name="<?php printf( 'charitable_settings[%s]', esc_attr( $view_args['name'] ) ); ?>" | |
| 28 | + value="<?php echo esc_attr( $charitable_option ); ?>" | |
| 29 | + <?php checked( $charitable_value, $charitable_option ); ?> | |
| 30 | + <?php echo charitable_get_arbitrary_attributes( $view_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | |
| 25 | 31 | /> |
| 26 | - <?php echo $label; ?> | |
| 32 | + <?php echo wp_kses_post( $charitable_label ); ?> | |
| 27 | 33 | </li> |
| 28 | 34 | <?php endforeach ?> |
| 29 | 35 | </ul> |
| 30 | 36 | <?php if ( isset( $view_args['help'] ) ) : ?> |
| 31 | - <div class="charitable-help"><?php echo $view_args['help']; ?></div> | |
| 32 | -<?php | |
| 37 | + <div class="charitable-help"><?php echo wp_kses_post( $view_args['help'] ); ?></div> | |
| 38 | + <?php | |
| 33 | 39 | endif; |