Filters

edd_set_payment_transaction_id

The edd_set_payment_transaction_id filter is applied to the transaction ID before it is set by the edd_set_payment_transaction_id() function. The filter receives two parameters: $transaction_id $payment_id For assistance, please open a ticket in the support forums.

edd_get_payment_transaction_id

The edd_get_payment_transaction_id filter is applied to the transaction ID that is returned by the edd_get_payment_transaction_id() function. The filter receives two parameters: $transaction_id $payment_id For assistance, please open a ticket in the support forums.

edd_email_attachments

The edd_email_attachments filter allows you to add / remove file attachments for emails sent through Easy Digital Downloads. It receives two parameters: $attachments – The attachments already attached to the email (none by default) $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_email_message

The edd_email_message filter is applied to the main message text for all emails sent through Easy Digital Downloads. It receives two parameters: $message – The email body text $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_email_heading

The edd_email_heading filter allows you to set the heading text applied to all emails sent through Easy Digital Downloads. For assistance, please open a ticket in the support forums.

edd_email_template

The edd_email_template filter allows you to force a specific email template to be used for all emails sent through Easy Digital Downloads. function pw_edd_change_email_template() { add_filter( ‘edd_email_template’, ‘pw_edd_set_email_template’ ); } add_action( ‘edd_email_send_before’, ‘pw_edd_change_email_template’ ); function pw_edd_set_email_template( $template_name ) { return ‘blue’; } For assistance, please open a ticket in the support forums.

edd_email_templates

The edd_email_templates filter allows you to register new email template names that can be applied to emails sent through Easy Digital Downloads. A new template can be registered by adding an additional key, value pair to the array: function pw_edd_register_email_template( $templates ) { $templates[‘my_custom_template’] = ‘My Custom Template Name’; return $templates; } add_filter( ‘edd_email_template’, ‘pw_edd_register_email_template’ ); The template […]

edd_email_content_type

The edd_email_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters: $content_type – The content type to be used if one is not specified. Defaults to text/html $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_email_default_content_type

The edd_email_default_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters: $content_type – The default content type to be used if one is not specified. Defaults to text/html $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_email_from_address

The edd_email_from_address filter is applied to the “From Address” for all emails sent through Easy Digital Downloads. It receives two parameters: $from_address – The email address to be used as the From Address $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_email_from_name

The edd_email_from_name filter is applied to the “From Name” for all emails sent through Easy Digital Downloads. It receives two parameters: $from_name – The From Name to be used $emails_object – The current instance of the EDD_Emails class For assistance, please open a ticket in the support forums.

edd_protected_directory_htaccess_rules

The edd_protected_directory_htaccess_rules filter allows you to change the rules placed in EDD’s .htaccess file for protecting file downloads. For assistance, please open a ticket in the support forums.

edd_purchase_form_required_fields

The edd_purchase_form_required_fields filter is used to change which fields during checkout are required. For an example, see this doc. For assistance, please open a ticket in the support forums.

Change Default Country for Billing Fields

Some payment gateways require that billing info, including country, be filled out. When using one of these gateways, you may want to change the country that is selected by default. This small code snippet will let you do that. The snippet should be added to a custom plugin or your theme’s functions.php file: function pw_set_edd_default_country( […]

edd_update_discount

This filter is applied to the discount data before a discount code is updated. apply_filters( ‘edd_update_discount’, $discount_details, $id ); $discount_details is an array of all fields for the discount. For assistance, please open a ticket in the support forums.

Custom Email Templates

This method is now deprecated, please see the new EDD_Emails class. Whenever a purchase is made, an email receipt is sent to the buyer. The way this email appears to the buyer can be easily customized using the email templating engine in EDD. For assistance, please open a ticket in the support forums.

Change Global Download Labels

The global labels, Download and Downloads, used throughout Easy Digital Downloads are extremely easy to change. Just use the simple filter function shown below: For assistance, please open a ticket in the support forums.

Adding Currency Support: edd_currencies

The “edd_currencies” filter allows you to easily add support for your own additional currencies to Easy Digital Downloads. For assistance, please open a ticket in the support forums.

Modify the Download Post Type Admin Labels

You can easily change the labels of the Downloads post type by placing a simple function in your theme’s functions.php, or any custom plugin. You might, for example, want to change “Downloads” to “Music”, or perhaps to “Products”. For assistance, please open a ticket in the support forums.

edd_email_template_tags filter

This filter allows you to add additional template tags to the email purchase receipts. For assistance, please open a ticket in the support forums.

edd_sale_notification

This filter can be used to customize the email that is sent to site admins when a download purchase is made. For assistance, please open a ticket in the support forums.

edd_purchase_receipt

This filter can be used to modify the purchase receipt email that is sent to users after purchasing downloads. For assistance, please open a ticket in the support forums.

edd_cart_item

The HTML for each item in the shopping cart (except on the checkout page) is passed through this filter. The filter includes one parameter, $item, which is a string containing the HTML code for the cart item. Each cart item is wrapped in <li> tags. For assistance, please open a ticket in the support forums.

edd_empty_cart_message

This filter is used when displaying the “your cart is empty” message and can be used to modify the message that is displayed. The sample below shows an example of how you could modify it: For assistance, please open a ticket in the support forums.

Error: Please enter a valid email address

Error: Invalid email