# give/2.3.0/includes/admin/shortcodes/shortcode-give-receipt.php

GiveWP – Donation Plugin and Fundraising Platform, version 2.3.0. 114 lines.

- Page: https://pluginprobe.com/plugins/give/2.3.0/code/includes/admin/shortcodes/shortcode-give-receipt.php
- Raw: https://pluginprobe.com/plugins/give/2.3.0/raw/includes/admin/shortcodes/shortcode-give-receipt.php
- Modified: 2018-06-19T07:29:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/2.3.0/code/includes/admin/shortcodes/shortcode-give-receipt.php#L10-L20`.

```php
<?php
/**
 * The [give_receipt] Shortcode Generator class
 *
 * @package     Give
 * @subpackage  Admin
 * @copyright   Copyright (c) 2016, WordImpress
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
 * @since       1.3.0
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Give_Shortcode_Donation_Receipt
 */
class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator {

	/**
	 * Class constructor
	 */
	public function __construct() {

		$this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' );
		$this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' );

		parent::__construct( 'give_receipt' );
	}

	/**
	 * Define the shortcode attribute fields
	 *
	 * @return array
	 */
	public function define_fields() {

		return array(
			array(
				'type' => 'container',
				'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
			),
			array(
				'type'    => 'listbox',
				'name'    => 'price',
				'label'   => esc_html__( 'Show Donation Amount:', 'give' ),
				'options' => array(
					'false' => esc_html__( 'Hide', 'give' ),
				),
				'placeholder' => esc_html__( 'Show', 'give' )
			),
			array(
				'type'    => 'listbox',
				'name'    => 'donor',
				'label'   => esc_html__( 'Show Donor Name:', 'give' ),
				'options' => array(
					'true'  => esc_html__( 'Show', 'give' ),
					'false' => esc_html__( 'Hide', 'give' ),
				),
				'placeholder' => esc_html__( 'Show', 'give' )
			),
			array(
				'type'    => 'listbox',
				'name'    => 'date',
				'label'   => esc_html__( 'Show Date:', 'give' ),
				'options' => array(
					'false' => esc_html__( 'Hide', 'give' ),
				),
				'placeholder' => esc_html__( 'Show', 'give' ),
			),
			array(
				'type'    => 'listbox',
				'name'    => 'payment_key',
				'label'   => esc_html__( 'Show Payment Key:', 'give' ),
				'options' => array(
					'true'  => esc_html__( 'Show', 'give' ),
				),
				'placeholder' => esc_html__( 'Hide', 'give' ),
			),
			array(
				'type'    => 'listbox',
				'name'    => 'payment_method',
				'label'   => esc_html__( 'Show Payment Method:', 'give' ),
				'options' => array(
					'false' => esc_html__( 'Hide', 'give' ),
				),
				'placeholder' => esc_html__( 'Show', 'give' ),
			),
			array(
				'type'    => 'listbox',
				'name'    => 'payment_id',
				'label'   => esc_html__( 'Show Payment ID:', 'give' ),
				'options' => array(
					'false' => esc_html__( 'Hide', 'give' ),
				),
				'placeholder' => esc_html__( 'Show', 'give' ),
			),
			array(
				'type'    => 'listbox',
				'name'    => 'company_name',
				'label'   => esc_html__( 'Company Name:', 'give' ),
				'options' => array(
					'true' => esc_html__( 'Show', 'give' ),
				),
				'placeholder' => esc_html__( 'Hide', 'give' )
			),
		);
	}
}

new Give_Shortcode_Donation_Receipt;

```
