WordPress Snippets at WPcustoms

Show FREE if price is 0.00

Show $0.00 prices as “Free” in Easy Digital Downloads


/**
 * Snippet Name: Show FREE if price is 0.00
 * Snippet URL: https://wpcustoms.net/snippets/show-free-price-0-00/
 */
  function pw_format_currency( $formatted, $currency, $price ) {
 
	if( ! is_admin() && $price == 0.00 ) {
		return 'Free'
	}
 
}
add_filter( 'edd_usd_currency_filter_before', 'pw_format_currency', 10, 3 );