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

Custom Post Type: Reviews

/* * Creating a function to create our CPT */ function reviews_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( ‘name’ => _x( ‘Reviews’, ‘Post Type General Name’, ‘generatepress’ ), ‘singular_name’ => _x( ‘Reviews’, ‘Post Type…Continue reading

Disable Wish Lists by Category

function jp_disable_wish_list() { // replace category-goes-here below with your category slug if ( is_singular( ‘download’) && is_object_in_term( get_the_ID(), ‘download_category’, ‘category-slug-goes-here’ ) ) { remove_action( ‘edd_purchase_link_top’, ‘edd_wl_load_wish_list_link’ ); } } add_action( ‘template_redirect’, ‘jp_disable_wish_list’, 100 );Continue reading

Retroactive License Emails

/** * Initialize the plugin when an ajax call is made by the retroactive license * generation process. We don’t want to send out a duplicate email during the * normal purchase process, so this way the plugin does nothing…Continue reading

License Keys UL – Email Tag for Software Licensing

if ( ! defined( ‘ABSPATH’ ) ) exit; function my_custom_sl_emails_initialize(){ if ( class_exists( ‘EDD_SL_Emails’ ) ) { edd_add_email_tag( ‘license_keys_ul’, __( ‘Show all purchased licenses in an unordered list’, ‘edd_sl’ ), ‘my_custom_license_keys_ul_tag’ ); } } add_action( ‘init’, ‘my_custom_sl_emails_initialize’ ); function my_custom_license_keys_ul_tag(…Continue reading

Disable Renewal Notice for Specific Products

// Disables renewal notices for specific products function pw_edd_disable_product_renewal_notice( $should_send, $license_id, $notice_id ) { $download_id = (int) edd_software_licensing()->get_download_id( $license_id ); $price_id = (int) edd_software_licensing()->get_price_id( $license_id ); if( 55 === $download_id ) { // Do not send for download with an…Continue reading

Readme.txt Parsing Enhancements

function jp_edd_readme_filter( $response, $download, $readme ) { // Update the current version number for a download $meta_version = get_post_meta( $download->ID, ‘_edd_sl_version’, true ); if ( ” != $readme[‘stable_tag’] && $meta_version != $readme[‘stable_tag’] ) { update_post_meta( $download->ID, ‘_edd_sl_version’, $readme[‘stable_tag’] ); }…Continue reading

Disable Renewals for Specific Products

/** * Prevent licenses from being renewed for certain products. * * @param bool $can_renew * @param int $license_id * * @return bool */ function ag_edd_sl_can_renew( $can_renew, $license_id ) { // Bail if they already can’t renew. if ( !…Continue reading