This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function child_theme_slug_setup() { | |
load_child_theme_textdomain( 'parent-theme-slug', get_stylesheet_directory() . '/languages' ); | |
} | |
add_action( 'after_setup_theme', 'child_theme_slug_setup' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
// vendor submission redirect | |
function sd_fes_vendor_submission_redirect( $output, $post_id, $form_id ) { | |
$output['redirect_to'] = 'http://google.com/'; | |
return $output; | |
} | |
add_filter( 'fes_add_post_redirect', 'sd_fes_vendor_submission_redirect', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
function disable_srcset( $sources ) { | |
return false; | |
} | |
add_filter( 'wp_calculate_image_srcset', 'disable_srcset' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
/** | |
* Prevents items from being added to the cart multiple times | |
*/ | |
function pw_edd_prevent_duplicate_cart_items( $download_id, $options ) { | |
if( edd_item_in_cart( $download_id, $options ) ) { | |
if( edd_is_ajax_enabled() && defined( 'DOING_AJAX' ) ) { | |
die('1'); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// removing hard cropping from Vendd product image | |
add_filter( 'vendd_crop_product_image', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
function jp_filter_edd_price( $formatted_price, $download_id, $price, $price_id ) { | |
if( ! edd_has_variable_prices( $download_id ) && 0 == $price ) { | |
$formatted_price = '<span class="edd_price" id="edd_price_' . $download_id . '">Free</span>'; | |
} | |
return $formatted_price; | |
} | |
add_filter( 'edd_download_price_after_html', 'jp_filter_edd_price', 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
/** | |
* Add download links note to purchase receipt | |
*/ | |
function sd_download_note_purchase_receipt() { | |
?> | |
<p class="receipt-download-note"><strong><em>Click the link(s) below to download your purchase.</em></strong></p> | |
<? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
function sd_wallet_desposit_levels( $levels ) { | |
// add new deposit levels to default list | |
$more_levels = array( '2000', '5000' ); | |
return array_merge( $levels, $more_levels ); | |
} | |
add_filter( 'edd_wallet_deposit_levels', 'sd_wallet_desposit_levels' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DO NOT COPY THIS LINE | |
/** | |
* Prevents logged-in customers from purchasing an item twice | |
*/ | |
function pw_edd_prevent_duplicate_purchase( $valid_data, $posted ) { | |
$cart_contents = edd_get_cart_contents(); | |
foreach( $cart_contents as $item ) { | |
if( edd_has_user_purchased( get_current_user_id(), $item['id'] ) ) { |