PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
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.8.13, at templates/form-fields/picture-preview.php

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