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:d5b82f66a6d38b6a3840
Created July 12, 2015 17:13
EDD Content Restriction Remove Pages from Purchase Confirmation
function sd_remove_cr_pages() {
remove_action( 'edd_payment_receipt_after', 'edd_cr_add_to_receipt', 1, 2 );
}
add_action( 'init', 'sd_remove_cr_pages' );
@SeanChDavis
SeanChDavis / gist:1c6491f448529793af89
Last active August 29, 2015 14:24
Vendd (1.1.2) - Download Sidebar Defaults Above Widget Area
<?php
/**
* Overrides the sidebar-download.php file in the parent theme (Vendd)
*/
?>
<div id="secondary" class="widget-area" role="complementary">
<div class="widget widget_edd_product_details">
<?php
@SeanChDavis
SeanChDavis / gist:0ec87e37e5260dabe5b0
Last active September 9, 2015 19:18
EDD Replace Purchase Form w/ Download Link
<?php // DO NOT COPY THIS LINE
function ck_edd_user_download_button( $purchase_form, $args ) {
if ( !is_user_logged_in() )
return $purchase_form;
$download_id = (string)$args['download_id'];
$current_user_id = get_current_user_id();
@SeanChDavis
SeanChDavis / gist:b0591a2ce37f06a1104e
Created July 6, 2015 19:07
EDD FES - Redirect FES Login Form Success
function sd_fes_submission_redirect( $response, $userdata ) {
$response['redirect_to'] = 'http://google.com/';
return $response;
}
add_filter( 'fes_login_form_success_redirect', 'sd_fes_submission_redirect', 10, 2 );
@SeanChDavis
SeanChDavis / gist:6f29cffb0e8508e7d455
Created June 23, 2015 18:02
Vendd filter - header cart information display
// remove header cart information display
add_filter( 'vendd_show_header_cart_info', '__return_false' );
@SeanChDavis
SeanChDavis / gist:8b1b16f486fbec19c7d1
Created June 23, 2015 18:01
Vendd filter - download version number
// download-specific
function example_vendd_version( $version, $download ) {
if ( $download->ID == 123 ) {
$version = '2.4.2';
}
return $version;
}
add_filter( 'vendd_download_version', 'example_vendd_version', 10, 2 );
@SeanChDavis
SeanChDavis / gist:c94b3f6d1db81624aaf7
Created June 23, 2015 17:59
Vendd filter - download license state
// download-specific
function example_vendd_is_licensed( $is_licensed, $download ) {
if ( $download->ID == 123 ) {
$is_licensed = true;
}
return $is_licensed;
}
add_filter( 'vendd_download_is_licensed', 'example_vendd_is_licensed', 10, 2 );
@SeanChDavis
SeanChDavis / gist:f01ac142d969ede56db9
Created June 23, 2015 17:58
Vendd filter - download sales count in sidebar
// download-specific
function example_vendd_sales_count( $count, $post ) {
if ( $post->ID == 123 ) {
$count = 1000;
}
return $count;
}
add_filter( 'vendd_download_sales_count', 'example_vendd_sales_count', 10, 2 );
@SeanChDavis
SeanChDavis / gist:6a0e4164624998961234
Last active August 29, 2015 14:23
Vendd filter - download sales information in sidebar
// global
add_filter( 'vendd_show_sales_in_sidebar', '__return_true' );
// download-specific
function example_vendd_show_sales_in_sidebar( $show_sales, $download ) {
if ( $download->ID == 123 ) {
$show_sales = true;
}
return $show_sales;
}
@SeanChDavis
SeanChDavis / gist:6222547a69295b9b0dfc
Created June 23, 2015 17:34
Vendd filter - author links in single download sidebar
// global
add_filter( 'vendd_show_single_download_author_links', '__return_false' );
// download-specific
function example_vendd_show_single_download_author_links( $show_author_links, $post ) {
if ( $post->ID == 123 ) {
$show_author_links = false;
}
return $show_author_links;
}