| @@ -1,12 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * The template used to display the user fields. |
| 4 | 4 | * |
| 5 | - * @author Studio 164a | |
| 5 | + * @author WP Charitable LLC | |
| 6 | 6 | * @package Charitable/Templates/Donation Form |
| 7 | 7 | * @since 1.0.0 |
| 8 | - * @version 1.6.0 | |
| 8 | + * @version 1.8.9.1 | |
| 9 | + * @version 1.8.8.6 | |
| 9 | 10 | */ |
| 10 | 11 | |
| 11 | 12 | // Exit if accessed directly. |
| 12 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -16,30 +17,30 @@ | ||
| 16 | 17 | if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) { |
| 17 | 18 | return; |
| 18 | 19 | } |
| 19 | 20 | |
| 20 | -$form = $view_args['form']; | |
| 21 | -$field = $view_args['field']; | |
| 22 | -$fields = isset( $field['fields'] ) ? $field['fields'] : array(); | |
| 23 | -$classes = array(); | |
| 21 | +$charitable_form = $view_args['form']; | |
| 22 | +$charitable_field = $view_args['field']; | |
| 23 | +$charitable_fields = isset( $charitable_field['fields'] ) ? $charitable_field['fields'] : array(); | |
| 24 | +$charitable_classes = array(); | |
| 24 | 25 | |
| 25 | -if ( $form->should_hide_user_fields() ) { | |
| 26 | - $classes[] = 'charitable-hidden'; | |
| 26 | +if ( $charitable_form->should_hide_user_fields() ) { | |
| 27 | + $charitable_classes[] = 'charitable-hidden'; | |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | -if ( count( $form->get_meta_fields() ) ) { | |
| 30 | - $classes[] = 'bordered'; | |
| 30 | +if ( count( $charitable_form->get_meta_fields() ) ) { | |
| 31 | + $charitable_classes[] = 'bordered'; | |
| 31 | 32 | } |
| 32 | 33 | |
| 33 | -$class = empty( $classes ) ? '' : 'class="' . implode( ' ', $classes ) . '"'; | |
| 34 | +$charitable_class = empty( $charitable_classes ) ? '' : 'class="' . implode( ' ', $charitable_classes ) . '"'; | |
| 34 | 35 | |
| 35 | -if ( empty( $fields ) ) { | |
| 36 | +if ( empty( $charitable_fields ) ) { | |
| 36 | 37 | return; |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | -if ( isset( $field['legend'] ) ) : | |
| 40 | +if ( isset( $charitable_field['legend'] ) ) : | |
| 40 | 41 | ?> |
| 41 | - <div class="charitable-form-header"><?php echo $field['legend']; ?></div> | |
| 42 | + <div class="charitable-form-header"><?php echo wp_kses_post( $charitable_field['legend'] ); ?></div> | |
| 42 | 43 | <?php |
| 43 | 44 | endif; |
| 44 | 45 | |
| 45 | 46 | /** |
| @@ -48,13 +49,13 @@ | ||
| 48 | 49 | * @since 1.0.0 |
| 49 | 50 | * |
| 50 | 51 | * @param Charitable_Donation_Form $form The donation form instance. |
| 51 | 52 | */ |
| 52 | -do_action( 'charitable_donation_form_donor_fields_before', $form ); | |
| 53 | +do_action( 'charitable_donation_form_donor_fields_before', $charitable_form ); | |
| 53 | 54 | |
| 54 | 55 | ?> |
| 55 | - <div id="charitable-user-fields" <?php echo $class; ?>> | |
| 56 | - <?php $form->view()->render_fields( $fields ); ?> | |
| 56 | + <div id="charitable-user-fields" <?php echo esc_attr( $charitable_class ); ?>> | |
| 57 | + <?php $charitable_form->view()->render_fields( $charitable_fields ); ?> | |
| 57 | 58 | </div><!-- #charitable-user-fields --> |
| 58 | 59 | <?php |
| 59 | 60 | |
| 60 | 61 | /** |
| @@ -63,5 +64,5 @@ | ||
| 63 | 64 | * @since 1.0.0 |
| 64 | 65 | * |
| 65 | 66 | * @param Charitable_Donation_Form $form The donation form instance. |
| 66 | 67 | */ |
| 67 | -do_action( 'charitable_donation_form_donor_fields_after', $form ); | |
| 68 | +do_action( 'charitable_donation_form_donor_fields_after', $charitable_form ); | |