| @@ -1,12 +1,19 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 3 | +// Exit if accessed directly. | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | + | |
| 2 | 8 | /** |
| 3 | 9 | * The template used to display the WP Editor in a form. |
| 4 | 10 | * |
| 5 | - * @author Studio 164a | |
| 11 | + * @author WP Charitable LLC | |
| 6 | 12 | * @package Charitable/Templates/Form Fields |
| 7 | 13 | * @since 1.0.0 |
| 8 | 14 | * @version 1.0.0 |
| 15 | + * @version 1.8.8.6 | |
| 9 | 16 | */ |
| 10 | 17 | |
| 11 | 18 | if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) { |
| 12 | 19 | return; |
| @@ -11,14 +18,14 @@ | ||
| 11 | 18 | if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) { |
| 12 | 19 | return; |
| 13 | 20 | } |
| 14 | 21 | |
| 15 | -$form = $view_args['form']; | |
| 16 | -$field = $view_args['field']; | |
| 17 | -$classes = $view_args['classes']; | |
| 18 | -$is_required = isset( $field['required'] ) ? $field['required'] : false; | |
| 19 | -$value = isset( $field['value'] ) ? $field['value'] : ''; | |
| 20 | -$editor_args = isset( $field['editor'] ) ? wpautop( $field['editor'] ) : array(); | |
| 22 | +$charitable_form = $view_args['form']; | |
| 23 | +$charitable_field = $view_args['field']; | |
| 24 | +$charitable_classes = $view_args['classes']; | |
| 25 | +$charitable_is_required = isset( $charitable_field['required'] ) ? $charitable_field['required'] : false; | |
| 26 | +$charitable_value = isset( $charitable_field['value'] ) ? $charitable_field['value'] : ''; | |
| 27 | +$charitable_editor_args = isset( $charitable_field['editor'] ) ? wpautop( $charitable_field['editor'] ) : array(); | |
| 21 | 28 | |
| 22 | 29 | /** |
| 23 | 30 | * Change the editor settings. |
| 24 | 31 | * |
| @@ -27,9 +34,9 @@ | ||
| 27 | 34 | * @since 1.5.0 |
| 28 | 35 | * |
| 29 | 36 | * @param array $settings The default settings. |
| 30 | 37 | */ |
| 31 | -$default_editor_args = array( | |
| 38 | +$charitable_default_editor_args = array( | |
| 32 | 39 | 'media_buttons' => true, |
| 33 | 40 | 'teeny' => true, |
| 34 | 41 | 'quicktags' => false, |
| 35 | 42 | 'tinymce' => array( |
| @@ -37,19 +44,19 @@ | ||
| 37 | 44 | 'theme_advanced_buttons1' => 'bold,italic,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink', |
| 38 | 45 | ), |
| 39 | 46 | ); |
| 40 | 47 | |
| 41 | -$editor_args = wp_parse_args( $editor_args, $default_editor_args ); | |
| 48 | +$charitable_editor_args = wp_parse_args( $charitable_editor_args, $charitable_default_editor_args ); | |
| 42 | 49 | ?> |
| 43 | -<div id="charitable_field_<?php echo $field['key'] ?>" class="<?php echo $classes ?>"> | |
| 44 | - <?php if ( isset( $field['label'] ) ) : ?> | |
| 45 | - <label for="<?php echo esc_attr( $field['key'] ) ?>"> | |
| 46 | - <?php echo $field['label'] ?> | |
| 47 | - <?php if ( $is_required ) : ?> | |
| 48 | - <abbr class="required" title="required">*</abbr> | |
| 50 | +<div id="charitable_field_<?php echo esc_attr( $charitable_field['key'] ); ?>" class="<?php echo esc_attr( $charitable_classes ); ?>"> | |
| 51 | + <?php if ( isset( $charitable_field['label'] ) ) : ?> | |
| 52 | + <label for="<?php echo esc_attr( $charitable_field['key'] ); ?>"> | |
| 53 | + <?php echo wp_kses_post( $charitable_field['label'] ); ?> | |
| 54 | + <?php if ( $charitable_is_required ) : ?> | |
| 55 | + <abbr class="required" title="<?php esc_html_e( 'Required', 'charitable' ); ?>">*</abbr> | |
| 49 | 56 | <?php endif ?> |
| 50 | 57 | </label> |
| 51 | 58 | <?php endif ?> |
| 52 | 59 | <?php |
| 53 | - wp_editor( $value, $field['key'], $editor_args ); | |
| 60 | + wp_editor( $charitable_value, $charitable_field['key'], $charitable_editor_args ); | |
| 54 | 61 | ?> |
| 55 | 62 | </div> |