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:9e0d0513b91adf8f4c5d
Last active October 7, 2016 16:07
Change EDD variable pricing radios to drop down select menu
<?php
/*
* Convert variable prices from radio buttons to a dropdown
*
* === JUST COPY THE CODE STARTING ON LINE 7 ===
*/
function edd_purchase_variable_pricing_dropdown( $download_id ) {
$variable_pricing = edd_has_variable_prices( $download_id );
@SeanChDavis
SeanChDavis / gist:b08948d38257c2d0745c
Last active August 29, 2015 14:03
adds "view details" link to EDD [downloads] shortcode
<?php
/**
* adds "view details" link to [downloads] shortcode
*/
function custom_view_details_link() { ?>
<a title="<?php the_title_attribute(); ?>" itemprop="url" href="<?php the_permalink(); ?>">View Details</a>
<?php }
add_action( 'edd_download_after', 'custom_view_details_link' );
@SeanChDavis
SeanChDavis / gist:fc4f8cba12b83e5d0f58
Last active August 29, 2015 14:03
Move Payment Gateway Icons
<?php // DO NOT COPY THIS LINE
// remove payment gateway icon from above purchase form
remove_action( 'edd_checkout_form_top', 'edd_show_payment_icons' );
// add message below purchase button
function custom_payment_icon_message() { ?>
<span class="payment-icon-message">This is a special message.</span>
<?php }
<?php
/**
* @package WordPress
* @subpackage Smartbox
*/
get_header(); ?>
<?php
function custom_edd_admin_footer_for_thickbox() {
global $pagenow, $typenow;
// Only run in post/page creation and edit screens
if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) { ?>
<script type="text/javascript">
function insertDownload() {
var id = jQuery('#products').val(),
direct = jQuery('#select-edd-direct').val(),
style = jQuery('#select-edd-style').val(),
@SeanChDavis
SeanChDavis / gist:d79c23d5cc09da4c9bcb
Created July 30, 2014 17:55
EDD Custom Register/Login on Checkout
<?php
/**
* Checkout Registrition Form
*/
function custom_edd_get_login_fields() {
global $edd_options;
$color = isset( $edd_options[ 'checkout_color' ] ) ? $edd_options[ 'checkout_color' ] : 'gray';
$color = ( $color == 'inherit' ) ? '' : $color;
$style = isset( $edd_options[ 'button_style' ] ) ? $edd_options[ 'button_style' ] : 'button';
@SeanChDavis
SeanChDavis / gist:161dbb254600948d3f5a
Created July 31, 2014 02:38
EDD Double Purchase Buttons
<?php
/**
* add "Buy Now" button below Add to Cart button on single downloads
*/
function custom_buy_now_button() { ?>
<a href="<?php echo edd_get_checkout_uri() . '?edd_action=add_to_cart&download_id=' . get_the_ID(); ?>">Buy Now</a>
<?php }
add_action( 'edd_purchase_link_end', 'custom_buy_now_button' );
@SeanChDavis
SeanChDavis / gist:8b2ca03a3b8e13933422
Last active August 29, 2015 14:04
EDD Categories and Tags
<?php
/**
* Use "download_category" for categories and "download_tag" for tags
*/
the_terms( $post->ID, 'download_category', '<span class="download-categories-title">Categories:</span> ', ', ', '' );
@SeanChDavis
SeanChDavis / gist:fc776e650b8b2d93efd8
Last active August 29, 2015 14:04
EDD Add Categories/Tags to [downloads] shortcode in custom function
<?php
/*
* Use "download_category" for categories and "download_tag" for tags
*/
function custom_display_download_cats() {
the_terms( $post->ID, 'download_category', '<span class="download-categories-title">Categories:</span> ', ', ', '' );
}
add_action( 'edd_download_after', 'custom_display_download_cats' );
@SeanChDavis
SeanChDavis / gist:352fe482dfef85a1dd95
Created August 8, 2014 13:35
EDD Single Download Total Earnings
<?php echo edd_currency_filter( edd_format_amount( edd_get_download_earnings_stats( get_the_ID() ) ) ); ?>