PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / includes / admin / shortcodes / shortcode-give-receipt.php

shortcode-give-receipt.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at includes/admin/shortcodes/shortcode-give-receipt.php

115 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The [give_receipt] Shortcode Generator class
4 *
5 * @package Give
6 * @subpackage Admin
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 * @since 1.3.0
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Class Give_Shortcode_Donation_Receipt
19 */
20 class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator {
21
22 /**
23 * Class constructor
24 */
25 public function __construct() {
26
27 $this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' );
28 $this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' );
29
30 parent::__construct( 'give_receipt' );
31 }
32
33 /**
34 * Define the shortcode attribute fields
35 *
36 * @return array
37 */
38 public function define_fields() {
39
40 return array(
41 array(
42 'type' => 'container',
43 'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
44 ),
45 array(
46 'type' => 'listbox',
47 'name' => 'price',
48 'label' => esc_html__( 'Show Donation Amount:', 'give' ),
49 'options' => array(
50 'false' => esc_html__( 'Hide', 'give' ),
51 ),
52 'placeholder' => esc_html__( 'Show', 'give' ),
53 ),
54 array(
55 'type' => 'listbox',
56 'name' => 'donor',
57 'label' => esc_html__( 'Show Donor Name:', 'give' ),
58 'options' => array(
59 'true' => esc_html__( 'Show', 'give' ),
60 'false' => esc_html__( 'Hide', 'give' ),
61 ),
62 'placeholder' => esc_html__( 'Show', 'give' ),
63 ),
64 array(
65 'type' => 'listbox',
66 'name' => 'date',
67 'label' => esc_html__( 'Show Date:', 'give' ),
68 'options' => array(
69 'false' => esc_html__( 'Hide', 'give' ),
70 ),
71 'placeholder' => esc_html__( 'Show', 'give' ),
72 ),
73 array(
74 'type' => 'listbox',
75 'name' => 'payment_method',
76 'label' => esc_html__( 'Show Payment Method:', 'give' ),
77 'options' => array(
78 'false' => esc_html__( 'Hide', 'give' ),
79 ),
80 'placeholder' => esc_html__( 'Show', 'give' ),
81 ),
82 array(
83 'type' => 'listbox',
84 'name' => 'payment_id',
85 'label' => esc_html__( 'Show Payment ID:', 'give' ),
86 'options' => array(
87 'false' => esc_html__( 'Hide', 'give' ),
88 ),
89 'placeholder' => esc_html__( 'Show', 'give' ),
90 ),
91 array(
92 'type' => 'listbox',
93 'name' => 'company_name',
94 'label' => esc_html__( 'Company Name:', 'give' ),
95 'options' => array(
96 'true' => esc_html__( 'Show', 'give' ),
97 ),
98 'placeholder' => esc_html__( 'Hide', 'give' ),
99 ),
100 array(
101 'type' => 'docs_link',
102 'text' => esc_html__( 'Learn more about the Donation Receipt Shortcode', 'give' ),
103 'link' => 'http://docs.givewp.com/shortcode-donation-receipt',
104 ),
105 );
106 }
107 }
108
109 /**
110 * @since 4.3.0 use init action
111 */
112 add_action( 'init', static function () {
113 new Give_Shortcode_Donation_Receipt();
114 });
115