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:c4af1fec6d59bb139eaa
Last active August 29, 2015 14:16
EDD {downloads} email tag
<?php // DO NOT COPY THIS LINE
/**
* Add a {downloads} tag for use in either the purchase receipt email or admin notification emails
*/
edd_add_email_tag( 'downloads', __( 'A linked list of downloads purchased', 'edd' ), 'sumobi_edd_email_tag_downloads' );
/**
* The {downloads} email tag (no links)
*/
@SeanChDavis
SeanChDavis / gist:1940951e073f2152e3f8
Created February 12, 2015 15:48
EDD - Move Payment Gateway Icons Above Credit Card Form
<?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 payment gateway above CC form
add_action( 'edd_before_cc_fields', 'edd_show_payment_icons' );
@SeanChDavis
SeanChDavis / gist:b8127c7ed3459f18437c
Created January 27, 2015 05:42
EDD Modify Payment Gateway Select
<?php // DO NOT COPY THIS LINE
/**
* remove old payment gateway select function
*/
remove_action( 'edd_payment_mode_select', 'edd_payment_mode_select' );
/**
* create and add new payment gateway select function
@SeanChDavis
SeanChDavis / gist:b7c04b65be67402e9610
Created January 25, 2015 16:59
EDD - Link to Product Page from Download History Table
Copy the history-downloads.php file from the EDD templates folder into
the "edd_templates" directory in active theme. Once completed...
FIND:
<td class="edd_download_download_name"><?php echo esc_html( $name ); ?></td>
REPLACE WITH:
<td class="edd_download_download_name"><a href="<?php echo esc_url( get_permalink( $download['id'] ) ); ?>"><?php echo esc_html( $name ); ?></a></td>
@SeanChDavis
SeanChDavis / gist:c66a608b613cf69fa9ae
Created January 20, 2015 17:11
FES Submission Form Success Redirect
<?php // DON'T COPY THIS LINE
function sd_fes_submission_redirect( $response, $post_id, $form_id ) {
$response['redirect_to'] = 'http://SITEURL.com/';
return $response;
}
add_filter( 'fes_add_post_redirect', 'sd_fes_submission_redirect', 10, 3 );
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package SimpleMag
* @since SimpleMag 1.4
**/
global $ti_option;
?>
<div id="search-2" class="widget widget_search">
<h3>SEARCH</h3>
<form method="get" id="searchform" action="http://curlsunderstood.com/" role="search">
<input type="text" name="s" id="s" value="NEW TEXT" onfocus="if(this.value=='NEW TEXT')this.value='';" onblur="if(this.value=='')this.value='NEW TEXT';" />
<button type="submit">
<i class="icon-search"></i>
</button>
</form>
</div>
@SeanChDavis
SeanChDavis / gist:a6fdc48a7e710d7e2be7
Last active August 29, 2015 14:12
EDD show automatic purchase button below content on download category archives
<?php // DO NOT COPY THIS LINE
/**
* remove original filter that adds purchase button below download content
*/
remove_filter( 'the_content', 'edd_after_download_content' );
/**
* add new filter that adds "is_archive()" to the conditional so
* that the button will also show on downloads archives
@SeanChDavis
SeanChDavis / gist:f54fe89d192905ef10b9
Last active August 29, 2015 14:09
EDD "Already Logged In" message for [edd_register]
<?php // DO NOT COPY THIS LINE
/**
* Show message instead of registration form [edd_register] when user is logged in
*/
function sd_already_registered_message() {
if ( is_user_logged_in() ) {
// custom message
$message = "You're already logged in.";
@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 );