This is a library of code snippets designed to help end users and theme or plugin developers.
If you are new to PHP or WordPress development, we recommend adding these code snippets using the Code Snippets plugin. This allows you to add the code directly within your WordPress dashboard.
For those a little more familiar with WordPress development, you can use the snippets to create simple standalone plugins. Read the WordPress documentation about creating a plugin.
Alternatively, you could add the snippets directly to your theme or child theme's functions.php file.
We welcome and encourage everyone to submit their code snippets. If you would like to submit your snippet, please fork the repository and then create a pull request.
- Unhook default Charitable template functions
- Add an "Hours" currency
- Add a new currency, with a currency symbol
- Add the User Dashboard menu at the top of all User Dashboard pages
- Change plugin text
- Load template files in the admin
- Remove form fields
- Change form fields
- Change the labels of form fields
- Change whether a form field is required
- Add HTML before form fields
- Add HTML after form fields
- Add a description/paragraph field to a form
- Adding a text field (detailed example)
- Adding a text field (condensed example)
- Adding a checkbox field
- Adding a select field
- Adding multiple fields at once
- Change State field to Province
- Make the donor address fields required
- Remove donation form fields
- Remove login form
- Set the minimum donation amount
- Allow people to make $0 "donations"
- Add campaign title as a header
- Display a specific donation form
- Move donor details section to end of form, after payment form
- Add an opt-out for receiving the donation receipt
- Show the Offline payment instructions in the donation form
- Change the donation cancellation URL
- Display a link back to the campaign from the donation receipt
- Display a summary of the amount raised for the campaign
- Set a custom donation receipt page
- Set a custom donation receipt page for offline donations
- Treat Pending donations as "Approved" donations
- Automatically mark Offline donations as Paid
- Add a Donate button with modal to your template
- Add email headers
- Copy the donation receipt to the website admin
- Send donation notifications to admin for Offline donations that are Pending
- Send donation receipt to customer for Offline donations that are Pending
- Remove campaign name from donation summaries in emails
- Add a custom campaign field to display in emails
- Add a custom donation field to display in emails
- Add the offline payment instructions to donation emails
- Use the Page template for campaigns
- Add featured image to the top of the campaign
- Remove campaign summary block
- Remove campaign summary block from a specific campaign
- Remove the donor count
- Remove the donor count from a specific campaign
- Add a progress bar before the campaign summary block
- Move the campaign summary block below the Extended Description
- Move the campaign summary block & description below the Extended Description
- Remove the funds raised & progress bar in the campaigns grid
- Remove the campaign descriptions from the campaigns grid
- Add a custom field to the campaigns grid
- Add a Read More link to the campaigns grid
- Change the Thumbnail size in the campaigns grid
- Display the campaign creator name in the campaign page and [campaigns] output
- Register a Post Parent field
- Disable description text santization
- Round the percentage donated to a whole number
- Change the amount shown as donated to a particular campaign
- Change the campaign slug base
- Change the campaign rewrite rules to disable the
with_frontsetting - Add a "Campaigns" menu tab to the WordPress dashboard
- Change the arguments passed to the login form (uses
wp_login_form()) - Redirect to the previous page after logging in
- Send emails to the new user and admin after a user registers
- Redirect the user to a custom page after registration
- Set the role of new users
- Collect shipping information in PayPal
- Set a custom item name for donations in PayPal
- Set the locale in PayPal
- Use a different currency for PayPal
- Show the Offline payment instructions in the donation form
- Set a custom donation receipt page for offline donations
- Automatically mark Offline donations as Paid
- Send the Campaign Creator Donation Notification for Offline donations when they're pending
- Add the offline payment instructions to donation emails
- Add select field
- Remove all user fields except for the name & email fields
- Add address fields to the "Your Details" section
- Automatically approve campaigns
- Allow ambassadors to edit the goal of an active campaign
- Change the categories & tags fields into dropdown (select) fields
- Remove the categories field
- Remove the organisation field
- Remove the tags field
- Remove the short description field
- Remove the user biography field
- Set default campaign name
- Set default campaign goal
- Set default text for full description field
- Set default country for Ambassadors
- Set the default category for new campaign submissions
- Set maximum length of Short Description field
- Add phone number field
- Change the Campaign Details header
- Change field labels
- Change editable fields to non-editable and vice versa
- Remove the campaign length field and replace with an end date field
- Add start date field
- Add field to "Who Are You Raising Money For?" section
- Add user details to funds recipient information
- Automatically set the Suggested Donations and custom donation settings
- Automatically set the campaign parent for all submitted campaigns
- Automatically set the campaign's end date
- Change the PayPal payout details field
- Redirect logged out users to the registration page
- Only allow users to create one campaign
- Prevent users from editing a published campaign
- Add a "Gallery" field to the campaign form and display the gallery on the campaign automatically
- Add a "Terms and Conditions" section to the campaign form
- Redirect to the campaign after submitting the form
- Change the recipient type labels for "Personal Causes" and "Your Organization"
- Add {campaign_donations} email tag
- Add a custom checkout field for specific campaigns
- Show the Easy Digital Downloads gateway used for donations
- Change the recurring period to weekly
- Change the recurring period to yearly
- Set a fixed recurring donation amount
- Automatically check the "Make it monthly" checkbox in the donation form
- Do not send recurring emails for pending donations unless they are offline
- Unhook a template
- Add the donate button to campaigns in a grid
- Add the read more link to campaigns in a grid
- Re-order the social network links
- Add a new social network
- Move the donate button on the campaign page
- Change the donation page title
- Prevent the donation receipt from loading in the user dashboard
- Turn off the campaign archive