User Switching

add_filter( ‘edd_report_customer_columns’, ‘gv_edd_report_customer_columns_add_user_switching’ ); /** * Add “Switch To” column to the list of columns in the EDD Customers table * * @param array $columns * * @return array */ function gv_edd_report_customer_columns_add_user_switching( $columns ) { if ( ! class_exists( ‘user_switching’…Continue reading

Download Archive Menu Item

function cor_edd_nav_menu_items_page( $posts ) { array_unshift( $posts, (object) array( ‘ID’ => 0, ‘object_id’ => – 1, ‘post_content’ => ”, ‘post_excerpt’ => ”, ‘post_parent’ => ”, ‘post_title’ => get_post_type_object( ‘download’ )->labels->menu_name, ‘post_type’ => ‘nav_menu_item’, ‘type’ => ‘custom’, ‘url’ => get_post_type_archive_link( ‘download’…Continue reading

Download Archive Menu Item

function cor_edd_nav_menu_items_page( $posts ) { array_unshift( $posts, (object) array( ‘ID’ => 0, ‘object_id’ => – 1, ‘post_content’ => ”, ‘post_excerpt’ => ”, ‘post_parent’ => ”, ‘post_title’ => get_post_type_object( ‘download’ )->labels->menu_name, ‘post_type’ => ‘nav_menu_item’, ‘type’ => ‘custom’, ‘url’ => get_post_type_archive_link( ‘download’…Continue reading

Restrict Dashboard Summary Widget

// remove sales summary widget remove_action( ‘wp_dashboard_setup’, ‘edd_register_dashboard_widgets’, 10 ); // add sales summary widget with new conditions function custom_edd_register_dashboard_widgets() { $user_id = get_current_user_id(); // comma separated list of user IDs to restrict – adjust as needed $no_access = array(…Continue reading

Publishing email

/** * Given a Download ID being published, if it’s not the same user as logged in, send an email about it being live * * @param int $post_id The download id being published * @return void */ function cl_edd_emailNotificationDownloadPublished(…Continue reading

Sample Email Template Tag

/* * These template tags can be used in the purchase receipt and admin sale notification emails */ class EDD_Sample_Email_Tag { function __construct() { add_action( ‘edd_add_email_tags’, array( $this, ‘add_sample_tag’ ), 100 ); } public function add_sample_tag() { edd_add_email_tag( ‘replace_with_your_tag’, ‘Put…Continue reading

Vendor Email Tag

/** * @link http://sumobi.com/show-shop-vendors-email-download-purchased/ * * Example: * For more information about your order, please contact one of the following vendors: * {vendor_emails} */ /** * Add a {vendor_emails} tag */ function sumobi_edd_email_tags( $email_tags ) { $email_tags[] = array( ‘tag’…Continue reading

Disable emails on free purchases

function jp_no_email_free( $payment_id ) { $amount = edd_get_payment_amount( $payment_id ); if ( 0 == $amount ) { remove_action( ‘edd_complete_purchase’, ‘edd_trigger_purchase_receipt’, 999, 1 ); // This disables customer purchase receipts remove_action( ‘edd_admin_sale_notice’, ‘edd_admin_email_notice’, 10, 2 ); // This disables email notices…Continue reading

Pre-approval Emails

/** * Send emails when purchase is pre-approved */ function edd_pre_approval_emails_send_emails( $payment_id, $new_status, $old_status ) { // Make sure that payments are only completed once if ( $old_status == ‘publish’ || $old_status == ‘complete’ ) { return; } // Make…Continue reading