Last active
January 3, 2016 18:19
-
-
Save amdrew/8501816 to your computer and use it in GitHub Desktop.
Filter EDD Hide Download's redirect when "Disable direct access to this download" is enabled, on a per download level
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 | |
function sumobi_custom_edd_hide_download_redirect( $url ) { | |
// download has ID of 17 | |
if ( '17' == get_the_ID() ) { | |
$url = 'http://easydigitaldownloads.com'; // redirect user to another external URL | |
} | |
// download has ID of 15 | |
if( '15' == get_the_ID() ) { | |
$url = get_permalink( '8' ); // redirect to another download which has an ID of 8 | |
} | |
// return our new URL | |
return $url; | |
} | |
add_filter( 'edd_hide_download_redirect', 'sumobi_custom_edd_hide_download_redirect' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment