Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created January 15, 2016 17:44
Show Gist options
  • Save SeanChDavis/b3b5494c8fc7fbd4209a to your computer and use it in GitHub Desktop.
Save SeanChDavis/b3b5494c8fc7fbd4209a to your computer and use it in GitHub Desktop.
EDD replace $0.00 with Free
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment