PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.12.2
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.12.2
1.8.13.1 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 All 212 releases
charitable / templates / shortcodes / donate-button.php

donate-button.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.12.2, at templates/shortcodes/donate-button.php

36 lines 1.6 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 simple donation button/link.
4 *
5 * Override this template by copying it to yourtheme/charitable/shortcodes/donate-button.php
6 *
7 * @author David Bisset
8 * @package Charitable/Templates/Shortcodes
9 * @since 1.8.2
10 * @version 1.8.8.6
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 $charitable_target_for_link = $view_args['new_tab'] ? ' target="_blank"' : '';
19 $charitable_target_for_button = $view_args['new_tab'] ? ' onclick="window.open(\'' . esc_url( $view_args['url'] ) . '\')" ' : ' onclick="location.href=\'' . esc_url( $view_args['url'] ) . '\'" ';
20
21 // if the type is a button, use a button element, otherwise use a link.
22 if ( 'link' === $view_args['type'] ) :
23
24 // filter esc_attr but prevent quotes from being encoded.
25 $charitable_target_for_link = str_replace( '&quot;', '"', esc_attr( $charitable_target_for_link ) );
26 $charitable_target_for_button = str_replace( '&quot;', '"', esc_attr( $charitable_target_for_button ) );
27 ?>
28
29 <a <?php echo $charitable_target_for_link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> href="<?php echo esc_url( $view_args['url'] ); ?>" class="<?php echo esc_attr( $view_args['css'] ); ?>"><?php echo esc_html( $view_args['label'] ); ?></a>
30
31 <?php else : ?>
32
33 <input <?php echo $charitable_target_for_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> id="charitable-donate-button-<?php echo intval( $view_args['campaign'] ); ?>" class="<?php echo esc_attr( $view_args['css'] ); ?>" type="button" value="<?php echo esc_html( $view_args['label'] ); ?>" />
34
35 <?php endif; ?>
36