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
function affwp_custom_email_headers( $headers ) { | |
// change this to be your new site name | |
$from = 'Your new site name'; | |
// change this to your email address that the email should come from | |
$email = '[email protected]'; | |
$headers[] = 'From: ' . $from . ' <' . $email . '>'; |
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
/** | |
* AffiliateWP - login and redirect affiliates to affiliate area | |
* All other users are redirected to the site's homepage | |
* | |
* Works when user logs in via the page where the [affiliate_login] shortcode is used | |
* Works when affiliate logs in via wp-login.php page so they don't see the admin | |
*/ | |
function affwp_custom_login_redirect( $user_login, $user ) { | |
$user_id = $user->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
/** | |
* Restrict quantity of download at checkout | |
*/ | |
function sumobi_edd_restrict_download_quantity( $valid_data, $post ) { | |
$download_id = 50; | |
$max_number = 4; | |
$cart_contents = edd_get_cart_contents(); |
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 referral email | |
*/ | |
function affwp_emails_referral_email( $message, $args ) { | |
$email = affwp_get_affiliate_email( $args['affiliate_id'] ); | |
$amount = html_entity_decode( affwp_currency_filter( $args['amount'] ), ENT_COMPAT, 'UTF-8' ); | |
$message = sprintf( __( "Congratulations %s!\n\n", "affiliate-wp" ), affiliate_wp()->affiliates->get_affiliate_name( $args['affiliate_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 | |
$affiliate_wp = affiliate_wp(); | |
remove_shortcode( 'affiliate_area', array( $affiliate_wp, 'affiliate_area' ) ); | |
add_shortcode( 'affiliate_area', 'affwp_custom_affiliate_area' ); | |
function affwp_custom_affiliate_area() { | |
ob_start(); |
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_fes_tos( $field, $form_vars, $id, $type, $form_id, $read_only, $args ) { | |
ob_start(); | |
?> | |
<div class="fes-fields"> | |
<span data-required="yes" data-type="radio"></span> | |
<label> | |
<input type="checkbox" name="fes_accept_toc" required="required" /> <a href="<?php echo site_url( 'my-terms' ); ?>" target="_blank">Accept My Terms | |
</label> |
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 product to cart if cart is empty | |
*/ | |
function sumobi_edd_add_to_cart_if_empty() { | |
$download_to_add = 123; | |
$cart = function_exists( 'edd_get_cart_contents' ) ? edd_get_cart_contents() : false; |
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
/** | |
* Add new twitter field to EDD register form | |
*/ | |
function sumobi_edd_add_registration_field() { | |
?> | |
<p> | |
<label for="edd-user-twitter-username"><?php _e( 'Twitter Username', 'edd' ); ?></label> | |
<input id="edd-user-twitter-username" class="edd-input" type="text" name="edd_user_twitter_username" /> | |
</p> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Landing page</title> | |
</head> | |
<body> |
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 - Frontend Submissions - Pay To Upload | |
* Plugin URI: | |
* Description: Forces the vendor to pay for each file uploaded before the product is published | |
* Author: Andrew Munro | |
* Author URI: http://sumobi.com | |
* Version: 1.0 | |
*/ |