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:ceb987cd4e09502ecc79
Created May 19, 2015 17:09
Temp: Fix EDD Coming Soon Error
One of the closing parenthesis just needs a shift.
Current:
<p id="edd-cs-voted" class="edd-cs-voted"><?php printf( __( apply_filters( 'edd_coming_soon_voted_message', 'We heard you! Your interest for this %s was duly noted.', 'edd-coming-soon' ), edd_get_label_singular( true ) ) ); ?></p>
Should Be:
<p id="edd-cs-voted" class="edd-cs-voted"><?php printf( __( apply_filters( 'edd_coming_soon_voted_message', 'We heard you! Your interest for this %s was duly noted.', 'edd-coming-soon' ) ), edd_get_label_singular( true ) ); ?></p>
@SeanChDavis
SeanChDavis / gist:4778b61db5a6847cedf5
Created May 4, 2015 15:52
EDD Remove Post Classes
<?php // DO NOT COPY THIS LINE
remove_filter( 'post_class', 'edd_add_download_post_classes', 20, 3 );
@SeanChDavis
SeanChDavis / gist:995583c0c428d8265a54
Created April 29, 2015 21:25
EDD FES Redirect Auto-approved Vendor Registration
<?php // DO NOT COPY THIS LINE
function sd_fes_registration_redirect( $response, $post_id, $form_id ) {
$response['redirect_to'] = 'http://google.com/';
return $response;
}
add_filter( 'fes_register_form_frontend_vendor', 'sd_fes_registration_redirect', 10, 3 );
@SeanChDavis
SeanChDavis / gist:e1849a0dfa8a8c72f002
Last active August 29, 2015 14:19
EDD Downloads taxonomy count adjustment
<?php // DO NOT COPY THIS LINE
// adjust downloads taxonomy loop
function sd_download_tax_count( $query ) {
if( ( $query->is_tax( 'download_category' ) || $query->is_tax( 'download_tag' ) ) && ! is_admin() && $query->is_main_query() ) {
$query->set( 'posts_per_page', 10 );
}
}
add_action( 'pre_get_posts', 'sd_download_tax_count' );
@SeanChDavis
SeanChDavis / gist:2185fa1a82aae377f36b
Created April 17, 2015 15:02
EDD filter purchase form submit button
<?php // DON'T COPY
function sd_purchase_button_class( $input ) {
$input = str_replace( 'class="edd-submit', 'class="edd-submit new-class', $input );
return $input;
}
add_filter( 'edd_checkout_button_purchase', 'sd_purchase_button_class' );
@SeanChDavis
SeanChDavis / gist:cd18834f235370a0bf37
Last active August 29, 2015 14:19
Add HTML attribute to WordPress menu item
<?php // DO NOT COPY THIS TOP LINE
function sd_nav_menu_attr( $atts, $item, $args )
{
// The ID of the target menu item
$menu_target = 99;
// inspect $item
if ($item->ID == $menu_target) {
$atts['attribute_name'] = "attribute_value";
@SeanChDavis
SeanChDavis / gist:e5e355bca08342df4b7b
Last active August 26, 2020 14:35
EDD Stripe Custom CC Form
<?php // do not copy this line
/**
* remove Stripe default CC form
*/
remove_action( 'edd_stripe_cc_form', 'edds_credit_card_form' );
/**
* add custom Stripe CC form
*/
@SeanChDavis
SeanChDavis / gist:9a5b5df9e45eeb44ba5b
Created March 24, 2015 21:18
EDD {buyers_address} email tag (replace {billing_address})
<?php // do not copy this line
/**
* Add a {buyers_address} tag for use in either the purchase receipt email or admin notification emails
*/
edd_add_email_tag( 'buyers_address', __( 'The buyer\'s billing address (modified)', 'edd' ), 'sd_edd_email_tag_buyers_address' );
/**
* The {buyers_address} email tag that place everything on its own line
*/
@SeanChDavis
SeanChDavis / gist:89cc77f35d956e018a72
Created March 17, 2015 19:24
Volatyl Override Single Post Template (generic)
<?php
/**
* Custom Template File
*/
get_header();
vol_html_before_content();
?>
<div id="main-content" class="full clearfix">
<div class="main clearfix">
@SeanChDavis
SeanChDavis / gist:a9ad040a15aa61e08b32
Created February 28, 2015 23:23
EDD - Change From Email for sales notifications (and purchase receipts at the moment)
<?php // DO NOT COPY THIS LINE
function edd_sale_notification_from_customer( $from_email, $payment_id, $payment_data ) {
$the_user_email = $payment_data[ 'user_info' ][ 'user_email' ];
if ( isset( $the_user_email ) ) {
return $the_user_email;
} else {
return $from_email;