This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sumobi_edd_get_download_file_dimensions() { | |
$download_files = edd_get_download_files( get_the_ID() ); | |
if ( $download_files ) { | |
foreach ( $download_files as $file ) { | |
$attachment_id = $file['attachment_id']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sumobi_edd_set_purchase_limit( $ret, $download_id ) { | |
return 1; | |
} | |
add_filter( 'edd_file_purchase_limit', 'sumobi_edd_set_purchase_limit', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prevent product from being purchased/added to cart, eg with ?add-to-cart=5735 or otherwise | |
*/ | |
function sumobi_wc_prevent_purchase_validation( $passed, $product_id ) { | |
$prevent_purchase = get_post_meta( $product_id, '_wc_prevent_purchase', true ); | |
if ( $prevent_purchase ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the email content types to HTML | |
*/ | |
function affwp_custom_email_headers( $headers ) { | |
$headers[] = "Content-type: text/html"; | |
return $headers; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the commission amount if products belong to certain categories | |
* | |
*/ | |
function affwp_custom_wc_commission_per_category( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) { | |
// You can specify an array of categories to alter the commission for. Separate by a comma and use either the term name, term_id, or slug | |
$categories = array( 'category-one', 5 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a new column for the customer's IP Address | |
*/ | |
function sumobi_edd_export_payments_csv_cols( $cols ) { | |
$cols['ip_address'] = 'IP Address'; | |
return $cols; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Easy Digital Downloads - Downloads Email Tag | |
Plugin URI: http://sumobi.com/ | |
Description: Adds a {downloads} email tag for use in email templates that outputs a simple list of linked downloads without file names | |
Version: 1.0 | |
Author: Andrew Munro, Sumobi | |
Author URI: http://sumobi.com/ | |
License: GPL-2.0+ | |
License URI: http://www.opensource.org/licenses/gpl-license.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* EDD Social Discounts - remove sharing buttons for free downloads | |
*/ | |
function sumobi_edd_social_discount_display_share_buttons() { | |
if ( edd_is_free_download( get_the_ID() ) ) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Edit the application accepted email | |
*/ | |
function affwp_custom_application_accepted_email( $message, $args ) { | |
$message = sprintf( __( "Congratulations %s!\n\n", "affiliate-wp" ), affiliate_wp()->affiliates->get_affiliate_name( $args['affiliate_id'] ) ); | |
$message .= sprintf( __( "Your affiliate application on %s has been accepted!\n\n", "affiliate-wp" ), home_url() ); | |
$message .= sprintf( __( "Log into your affiliate area at %s\n\n", "affiliate-wp" ), get_permalink( affiliate_wp()->settings->get( 'affiliates_page' ) ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function affwp_custom_disable_affiliate_to_affiliate_referrals( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) { | |
// affwp_is_affiliate() will check if the currently logged in user is an affilaite. | |
// if they are an affiliate, set the referral amount to 0.00 | |
if ( affwp_is_affiliate() ) { | |
$referral_amount = 0.00; | |
} |