File Size Display

function edd_ck_show_file_sizes( $post_id ) { $files = edd_get_download_files( $post_id, null ); $decimals = 2; $sz = ‘BKMGTP’; $header = _n( ‘File Size’, ‘File Sizes’, count( $files ), ‘edd’ ); echo ‘ ‘ . $header . ‘ ‘; echo ‘ ‘;…Continue reading

Show login form for logged out users

function jp_cr_login_form( $content ) { if ( ! function_exists( ‘edd_cr_is_restricted’ ) ) { return $content; } global $post; if ( ! is_object( $post ) ) { return $content; } if ( edd_cr_is_restricted( $post->ID ) && ! is_user_logged_in() ) { $content…Continue reading

Submission Form Redirect

function sd_fes_submission_redirect( $response, $post_id, $form_id ) { $response[‘redirect_to’] = ‘http://SITEURL.com/’; return $response; } add_filter( ‘fes_add_post_redirect’, ‘sd_fes_submission_redirect’, 10, 3 );Continue reading

Hide payment icons for trials

function edd_library_maybe_show_payment_icons() { if ( edd_recurring()->cart_has_free_trial() ) { add_filter( ‘edd_get_option_accepted_cards’, ‘__return_false’ ); } } add_action( ‘init’, ‘edd_library_maybe_show_payment_icons’, 99 );Continue reading

Replace Add to Cart With Download for Subscribers

add_filter( ‘edd_purchase_download_form’, ‘ck_edd_user_download_button_recurring’, 10, 2 ); function ck_edd_user_download_button_recurring( $purchase_form, $args ) { if( ! class_exists( ‘EDD_Recurring_Customer’ ) ) return $purchase_form; if( ! EDD_Recurring_Customer::is_customer_active( get_current_user_id() ) ) return $purchase_form; if ( !is_user_logged_in() ) return $purchase_form; $download_id = (string)$args[‘download_id’]; $current_user_id = get_current_user_id();…Continue reading

Auto Register Login Link

// replace the default WordPress login link in Auto Register email function custom_edd_auto_register_login_link( $default_email_body ) { // replace http://yoursite.com/sign-in with the URL you want to send users to $default_email_body = str_replace( wp_login_url(), ‘http://yoursite.com/sign-in’, $default_email_body ); return $default_email_body; } add_filter( ‘edd_auto_register_email_body’,…Continue reading

Company Field on Receipt

function pw_cfm_company_field( $payment, $edd_receipt_args ) { /* * TODO * * 1. Replace field label as appropriate * 2. Replace “company” with the meta_key entered in Checkout Fields Manager */ ?> :Continue reading

Remove Manage Sites

function kjm_remove_manage_sites_link() { if ( isset( $_GET[‘action’] ) && $_GET[‘action’] == ‘manage_licenses’ ) { add_filter( ‘edd_sl_force_activation_increase’, ‘__return_true’ ); } } add_action( ‘wp_head’, ‘kjm_remove_manage_sites_link’ );Continue reading

Conditional Gateway Fees

function cl_remove_gateway_fees_by_cart_total( $fee ) { // enter the cart total for no gateway fees $limit = 5; // get the cart total $cart_total = edd_get_cart_total(); if ( $cart_total >= $limit ) { // if the cart total is greater than…Continue reading