| 1 |
<?php |
| 2 |
/** |
| 3 |
* The [give_receipt] Shortcode Generator class |
| 4 |
* |
| 5 |
* @package Give |
| 6 |
* @subpackage Admin |
| 7 |
* @copyright Copyright (c) 2016, WordImpress |
| 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_key', |
| 76 |
'label' => esc_html__( 'Show Payment Key:', 'give' ), |
| 77 |
'options' => array( |
| 78 |
'true' => esc_html__( 'Show', 'give' ), |
| 79 |
), |
| 80 |
'placeholder' => esc_html__( 'Hide', 'give' ), |
| 81 |
), |
| 82 |
array( |
| 83 |
'type' => 'listbox', |
| 84 |
'name' => 'payment_method', |
| 85 |
'label' => esc_html__( 'Show Payment Method:', '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' => 'payment_id', |
| 94 |
'label' => esc_html__( 'Show Payment ID:', 'give' ), |
| 95 |
'options' => array( |
| 96 |
'false' => esc_html__( 'Hide', 'give' ), |
| 97 |
), |
| 98 |
'placeholder' => esc_html__( 'Show', 'give' ), |
| 99 |
), |
| 100 |
array( |
| 101 |
'type' => 'listbox', |
| 102 |
'name' => 'company_name', |
| 103 |
'label' => esc_html__( 'Company Name:', 'give' ), |
| 104 |
'options' => array( |
| 105 |
'true' => esc_html__( 'Show', 'give' ), |
| 106 |
), |
| 107 |
'placeholder' => esc_html__( 'Hide', 'give' ) |
| 108 |
), |
| 109 |
); |
| 110 |
} |
| 111 |
} |
| 112 |
|
| 113 |
new Give_Shortcode_Donation_Receipt; |
| 114 |
|