Expire pass when counter used up

function all_access_expire_pass_when_counter_used_up( $all_access_pass, $download, $requested_file, $email, $log_id ) { // Get the download ID we will deliver $download_to_deliver = is_numeric( $_GET[‘edd-all-access-download’] ) ? $_GET[‘edd-all-access-download’] : NULL; $price_id_to_deliver = isset( $_GET[‘edd-all-access-price-id’] ) && is_numeric( $_GET[‘edd-all-access-price-id’] ) ? $_GET[‘edd-all-access-price-id’] : false; $file_id_to_deliver…Continue reading

Hide file-specific download options

function my_custom_function_to_hide_file_specific_options( $hide_file_specific_options, $download_id ) { return true; } add_filter( ‘edd_all_access_download_form_hide_file_specific_download_options’, ‘my_custom_function_to_hide_file_specific_options’, 10, 2 );Continue reading

Only count last file

function all_access_only_count_last_file( $should_be_counted, $all_access_pass, $download_id, $requested_file, $email, $log ) { // This is the id of the file being downloaded using All Access $requested_file_id = isset( $_GET[‘edd-all-access-file-id’] ) ? $_GET[‘edd-all-access-file-id’] : 0; // Get the array of files attached to…Continue reading

Subscription Status Shortcode

/** * Add a shortcode which prints a small status description for * subscriptions that are active through Easy Digital Downloads Recurring * Payments platform. */ if ( !function_exists( ‘eddsss_subscription_status_shortcode’ ) ) { function eddsss_subscription_status_shortcode() { if ( !is_user_logged_in() ||…Continue reading

Disable recurring renewal notices for specific download

function kjm_disable_renewal_notice( $send, $subsciption_id ) { $subscription = new EDD_Subscription( $subsciption_id ); $purchased_product = $subscription->product_id; // Set this to be the ID of the download you wish to disable renewal notices for $no_email_product = 123; if ( $purchased_product == $no_email_product…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

Unlimited User Downloads for EDD Recurring

class EDD_Recurring_Unlimited_User_Downloads { function __construct() { if ( ! class_exists( ‘EDD_Recurring’ ) ) { return; } add_filter( ‘edd_recurring_download_has_access’, array( $this, ‘process_download’ ), 10, 4 ); add_action( ‘show_user_profile’, array( $this, ‘user_checkbox’ ) ); add_action( ‘edit_user_profile’, array( $this, ‘user_checkbox’ ) ); add_action(…Continue reading

Give Subscription on Purchase

function pw_edd_give_subscription_on_purchase( $payment_id ) { $user_id = edd_get_payment_user_id( $payment_id ); if( empty( $user_id ) || $user_id < 1 ) { return; } if( ! class_exists( 'EDD_Recurring_Customer' ) ) { return; } $customer = new EDD_Recurring_Customer; $customer->set_as_subscriber( $user_id ); $customer->set_customer_payment_id( $payment_id…Continue reading

Include Subscriptions in API

function pw_edd_recurring_include_payments_in_api( $query ) { if( ! defined( ‘EDD_DOING_API’ ) || ! EDD_DOING_API ) { return; } $query->__set( ‘post_status’, array( ‘publish’, ‘complete’, ‘edd_subscription’ ) ); } add_action( ‘edd_pre_get_payments’, ‘pw_edd_recurring_include_payments_in_api’, 100 );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