Created
June 4, 2021 14:04
-
-
Save Basilakis/50a93efa336a3d2a3504adb14d664bda to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Change the button text of a free download. Default is "Free - Add to Cart
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
/** | |
* Easy Digital Downloads | |
* Change the button text of a free download. Default is "Free - Add to Cart" | |
*/ | |
function cg_edd_free_download_text_args( $args ) { | |
// Enter the button text for a free download | |
$download_id = absint( $args['download_id'] ); | |
if ( 4915 == $download_id ) { | |
$args['text'] = 'Start Here'; | |
} else { | |
$args['text'] = 'Buy Now'; | |
} | |
return $args; | |
} | |
add_filter( 'edd_purchase_link_args', 'cg_edd_free_download_text_args' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment