This file contains 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 // DO NOT COPY THIS LINE | |
// remove sales summary widget | |
remove_action( 'wp_dashboard_setup', 'edd_register_dashboard_widgets', 10 ); | |
// add sales summary widget with new conditions | |
function sd_edd_register_dashboard_widgets() { | |
$no_access = array( 3, 20 ); // comma separated list of user IDs to restrict | |
$user_id = get_current_user_id(); |
This file contains 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 // DO NOT COPY THIS LINE | |
function sd_reviews_form_message( $message ) { | |
$note = '<p><em>Your email address will not be displayed publicly.</em></p>'; | |
$message = $note . $message; | |
return $message; | |
} | |
add_filter( 'edd_reviews_review_form_template', 'sd_reviews_form_message' ); |
This file contains 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 - Testing | |
Plugin URL: # | |
Description: Testing custom EDD code from a plugin | |
Version: 1.0 | |
Author: Sean Davis | |
Author URI: | |
*/ |
This file contains 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 // DO NOT COPY THIS LINE | |
// SL license key structure based on username, time purchased, md5 | |
function sd_edd_license_usernam_date_md5( $key, $license_id, $download_id, $payment_id, $cart_index ) { | |
$name = get_user_by( 'email', edd_get_payment_user_email( $payment_id ) ); | |
$date = get_post_field( 'post_date', $payment_id ); | |
$timestamp = strtotime($date); | |
$nice_date = date( 'Yndhis', $timestamp ); | |
$license = md5( $license_id ); |
This file contains 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 // do not copy this line | |
/** | |
* Make address fields required | |
*/ | |
function sd_edd_required_address_fields( $required_fields ) { | |
$required_fields['card_address'] = array( | |
'error_id' => 'invalid_address', | |
'error_message' => 'Please enter your full address' | |
); |
This file contains 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 // DO NOT COPY THIS LINE | |
function sd_remove_small_tag_email_receipt( $message ) { | |
$small = array( '<small>', '</small>' ); | |
$message = str_replace( $small, '', $message ); | |
return $message; | |
} | |
add_filter( 'edd_email_message', 'sd_remove_small_tag_email_receipt' ); |
This file contains 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 // DO NOT COPY THIS LINE | |
function sd_edd_order_category_downloads( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) | |
return; | |
if( $query->is_post_type_archive( 'download' ) ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
return; |
This file contains 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 // DO NOT COPY THIS LINE | |
function sd_add_text_above_free_downloads_form() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$( '#edd_free_download_form' ).before( '<p class="free-download-note">Your Text Here</p>' ); | |
}); | |
</script> | |
<?php |
This file contains 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 // DO NOT COPY THIS LINE | |
/** | |
* User vendor's display name for store name if unedited | |
*/ | |
function sd_fes_store_name_username() { | |
if ( class_exists( 'EDD_Front_End_Submissions' ) ) { | |
$the_vendor = wp_get_current_user(); | |
$vendor_name = get_user_meta( $the_vendor->ID, 'display_name', true ); | |
$vendor_store_name = get_user_meta( $the_vendor->ID, 'name_of_store', true ); |
This file contains 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 // DO NOT COPY THIS LINE | |
// add custom payment statuses | |
function sd_extra_payment_statuses( $statuses ) { | |
$statuses = array( | |
'pending' => __( 'Pending', 'edd' ), | |
'publish' => __( 'Complete', 'edd' ), | |
'refunded' => __( 'Refunded', 'edd' ), | |
'failed' => __( 'Failed', 'edd' ), | |
'abandoned' => __( 'Abandoned', 'edd' ), |