PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.6.31
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.6.31
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 1.8.0 All 210 releases
charitable / templates / form-fields / picture-preview.php

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

41 lines 1.1 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 Studio 164a
6 * @package Charitable/Templates/Form Fields
7 * @since 1.4.0
8 * @version 1.4.0
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
21 if ( is_numeric( $size ) ) {
22 $size = array( $size, $size );
23 }
24
25 ?>
26 <li <?php echo ! $is_src ? 'data-attachment-id="' . esc_attr( $image ) . '"' : ''; ?>>
27 <a href="#" class="remove-image button"><?php _e( 'Remove', 'charitable' ); ?></a>
28 <?php
29 if ( $is_src ) :
30 echo $image;
31 else :
32 ?>
33 <input type="hidden"
34 name="<?php echo esc_attr( $field['key'] . $multiple ); ?>"
35 id="charitable_field_<?php echo esc_attr( $field['key'] ); ?>_element"
36 value="<?php echo esc_attr( $image ); ?>"
37 />
38 <?php echo wp_get_attachment_image( $image, $size ); ?>
39 <?php endif ?>
40 </li>
41