GiveWP Donation History Shortcode
The [donation_history]
shortcode displays a table with the current user’s complete donation history as well as links to receipts for each donation. This article walks you through how to configure the shortcode and the various options.
GiveWP creates a new page called “Donation History” with this shortcode inserted into the content editor upon install. See the documentation on updating the “Donation History” page here. This shortcode does not currently have a block, but it has customizable arguments. For developers, the Donation History template can be customized as needed.
Why use the Donation History Shortcode?
The [donation_history]
shortcode on a page provides your logged-in or email-authenticated donors with a place to view their donation history and view individual receipts.
When this page is added, it allows your donors to check their donations, the payment info, and if you are using the PDF Receipts add-on, for example, it allows your donors to (re)download their receipts.
The default Donation History shortcode
[donation_history]
The default shortcode will output a donation history table like shown here:
Additional GiveWP Goal Shortcode Arguments
- ID: Choose if you want to display the column with the ID of the donation
- Shortcode attribute:
[id]
- Attribute values: the boolean value
[true]
(default),[false]
.
- Shortcode attribute:
- Date: Choose if you want to display the column with the date the donation was made.
- Shortcode attribute:
[date]
- Attribute values: the boolean value
[true]
,[false]
(default)
- Shortcode attribute:
- Donor: Choose if you want to display the column with the donor’s full name
- Shortcode attribute:
[donor]
- Attribute value: boolean value
[true]
or[false]
(default)
- Shortcode attribute:
- Donation Amount: Choose if you want to display the column with the donation amount
- Shortcode attribute:
[amount]
- Attribute value: boolean value
[true]
(default) or[false]
.
- Shortcode attribute:
- Payment Status: Choose if you want to display the column with the payment status of the donation
- Shortcode attribute:
[status]
- Attribute value: boolean value
[true]
or[false]
(default).
- Shortcode attribute:
- Payment Method: Choose if you want to display the column with the payment method the donation was made with
- Shortcode attribute:
[payment_method]
- Attribute value: boolean value
[true]
or[false]
(default)
- Shortcode attribute:
Assigning or Moving the Donation History Page
When you install GiveWP, the donation history page is automatically created and assigned to the Donation History Page under Donations > Settings > General > General. Most likely you won’t ever have to move or edit this shortcode. However, if you do need to switch the shortcode to another page, insert the code into any page and update the “Donation History Page” setting.
Example donation_history implementation
Here are some detailed examples of ways you can implement the [donation_history]
shortcode.
Hiding ID with Donation History Shortcode
[donation_history id="false"]
Hiding ID and Date with Donation History Shortcode
[donation_history id="false" date="false"]
Displaying all fields with Donation History Shortcode
[donation_history donor="true" status="true" payment_method="true"]
This shortcode is required to be on a WordPress page (not post) and the page must be set appropriately under GiveWP > Settings > General.