PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.7
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.7
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / templates / form-fields / picture-preview.php

picture-preview.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.7, at templates/form-fields/picture-preview.php

43 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template used to display a preview of an uploaded photo.
4 *
5 * @author WP Charitable LLC
6 * @package Charitable/Templates/Form Fields
7 * @since 1.4.0
8 * @version 1.6.43
9 */
10
11 if ( ! isset( $view_args['image'] ) || ! isset( $view_args['field'] ) ) {
12 return;
13 }
14
15 $image = $view_args['image'];
16 $field = $view_args['field'];
17 $size = isset( $field['size'] ) ? $field['size'] : 'thumbnail';
18 $multiple = isset( $field['max_uploads'] ) && $field['max_uploads'] > 1 ? '[]' : '';
19 $is_src = strpos( $image, 'img' ) !== false;
20 $remove_button_text = isset( $field['remove_button_text' ] ) ? $field['remove_button_text' ] : __( 'Remove', 'charitable' );
21 $remove_button_show = isset( $field['remove_button_show' ] ) && $field['remove_button_show' ];
22
23 if ( is_numeric( $size ) ) {
24 $size = array( $size, $size );
25 }
26
27 ?>
28 <li <?php echo ! $is_src ? 'data-attachment-id="' . esc_attr( $image ) . '"' : ''; ?>>
29 <a href="#" class="remove-image button" <?php if ( $remove_button_show ) echo 'style="display:block;"' ?>><?php echo $remove_button_text; ?></a>
30 <?php
31 if ( $is_src ) :
32 echo $image;
33 else :
34 ?>
35 <input type="hidden"
36 name="<?php echo esc_attr( $field['key'] . $multiple ); ?>"
37 id="charitable_field_<?php echo esc_attr( $field['key'] ); ?>_element"
38 value="<?php echo esc_attr( $image ); ?>"
39 />
40 <?php echo wp_get_attachment_image( $image, $size ); ?>
41 <?php endif ?>
42 </li>
43