Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active October 23, 2015 07:41
Show Gist options
  • Save SeanChDavis/02bf0647f5f142f83046 to your computer and use it in GitHub Desktop.
Save SeanChDavis/02bf0647f5f142f83046 to your computer and use it in GitHub Desktop.
Testing Plugin
<?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:
*/
/*********************************
----------- CUSTOM TEST ---------
*********************************/
/*********************************
------------ DEFAULTS -----------
*********************************/
function custom_js_testing() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
});
</script>
<?php
}
add_action( 'wp_footer', 'custom_js_testing' );
function custom_css_testing() {
?>
<style type="text/css">
</style>
<?php
}
add_action( 'wp_head', 'custom_css_testing' );
/*********************************
------------ PENDING ------------
*********************************/
/*
// Example shown how to base the MD5 off of the user's nicename and purchase date
function sd_edd_license_md5_user_and_date( $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( 'Y/n/d/h:i:s', $timestamp );
$license = md5( $license_id );
$key = $name->user_nicename . '_' . $timestamp . '_' . $license;
return $key;
}
add_filter( 'edd_sl_generate_license_key', 'sd_edd_license_md5_user_and_date', 10, 5 );
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment