Skip to content

Instantly share code, notes, and snippets.

View SeanChDavis's full-sized avatar
👋
Reach out.

Sean Christopher Davis SeanChDavis

👋
Reach out.
View GitHub Profile
@SeanChDavis
SeanChDavis / gist:b99b497f10cd1b1cf64d
Last active May 31, 2017 16:49
EDD Points & Rewards - message placement
<?php // don't copy this line
// Change callback function for points message
if ( class_exists( 'EDD_Points_Renderer' ) ) {
// remove default points message
remove_action( 'edd_before_download_content', array( $edd_points_render, 'edd_points_message_content' ), 10 );
// call new points message function
add_action( 'edd_before_download_content', 'sd_custom_points_message', 10 );
@SeanChDavis
SeanChDavis / gist:e9b94d2472eec107df17
Created November 1, 2014 20:14
EDD Modify Commissions Email Template
<?php // do NOT copy this opening PHP tag
/**** COPY AND PASTE EVERYTHING BELOW ****/
/**
* Remove default email template
*/
remove_action( 'eddc_insert_commission', 'eddc_email_alert', 10, 5 );
/**
* Build New email template for Commissions
<?php // DO NOT COPY THIS LINE
function sd_custom_downloads_excerpt( $post_excerpt ) {
$post_excerpt .= '<a href="' . get_the_permalink() . '">More</a>';
return $post_excerpt;
}
add_filter( 'edd_downloads_excerpt', 'sd_custom_downloads_excerpt' );
@SeanChDavis
SeanChDavis / gist:9df26c2305e9fed11100
Created September 10, 2014 13:09
EDD Store Front Display Category (or Tag)
<div class="products inner">
<div class="products-container clearfix">
<?php if ($products->have_posts()) : $i = 1; ?>
<?php while ($products->have_posts()) : $products->the_post(); ?>
<div class="product-box product<?php if($i % 4 == 0) { echo ' last'; } ?> border-box">
<div class="product-frame">
<a class="product-title" href="<?php the_permalink(); ?>">
<h2><?php the_title(); ?></h2>
</a>
<a href="<?php the_permalink(); ?>">
@SeanChDavis
SeanChDavis / gist:ad2e14a9b6f8e1193de4
Created September 9, 2014 02:04
EDD Move Points & Rewards Below Content
if ( class_exists( 'EDD_Points_Renderer' ) ) {
global $edd_points_render;
remove_action( 'edd_before_download_content', array( $edd_points_render, 'edd_points_message_content' ), 10 );
add_action( 'edd_after_download_content', array( $edd_points_render, 'edd_points_message_content' ), 0 );
}
@SeanChDavis
SeanChDavis / gist:68dcb7db5cba044ba1b1
Last active August 29, 2015 14:06
EDD Move Points & Rewards Single Download Output
if ( class_exists( 'EDD_Points_Renderer' ) ) {
global $edd_points_render;
remove_action( 'edd_before_download_content', array( $edd_points_render, 'edd_points_message_content' ), 10 );
add_action( 'edd_after_download_content', array( $edd_points_render, 'edd_points_message_content' ), 0 );
function custom_add_instructions() { ?>
<p><strong><span style="color: #ff0000;">2. Use the drop down below to select the template you desire.</span></strong></p>
<?php
}
add_action( 'edd_after_download_content', 'custom_add_instructions', 1 );
}
@SeanChDavis
SeanChDavis / gist:61553657a2c07261bdad
Last active August 29, 2015 14:06
Volatyl for EDD Override Single Download Template
<?php
/**
* override single download template
*/
global $options;
// Custom filter
$single_tags_text = apply_filters('single_tags_text', __('Tags: ', 'volatyl'));
get_header();
@SeanChDavis
SeanChDavis / gist:7bb3390fbee233f8612a
Last active August 29, 2015 14:06
EDD Lattice Custom Social Icons Function
/**
* custom function for footer icons
*/
function custom_lattice_icons() {
$twitter = get_theme_mod( 'lattice_twitter' );
$facebook = get_theme_mod( 'lattice_facebook' );
$instagram = get_theme_mod( 'lattice_instagram' );
$gplus = get_theme_mod( 'lattice_gplus' );
if ( $twitter || $facebook || $instagram || $gplus ) {
@SeanChDavis
SeanChDavis / gist:5abb86d10a45dcda1d0a
Created August 24, 2014 21:32
EDD Purchase Receipt - No Download Links
<?php
/**
* This template is used to display the purchase summary with [edd_receipt]
*/
global $edd_receipt_args, $edd_options;
$payment = get_post( $edd_receipt_args['id'] );
$meta = edd_get_payment_meta( $payment->ID );
$cart = edd_get_payment_meta_cart_details( $payment->ID, true );
$user = edd_get_payment_meta_user_info( $payment->ID );
@SeanChDavis
SeanChDavis / gist:068c9deee5223f46981f
Last active August 29, 2015 14:05
EDD Software Licensing Admin Notice Based on License State/Existence
<?php
/**
* If the license is not entered or is not valid, show notice. For use with EDD Software Licensing
*
* CHANGE sample_ TO YOUR FUNCTION PREFIX
*
* https://easydigitaldownloads.com/extensions/software-licensing/?ref=184
*/
function sample_admin_notice() {