Created
August 26, 2014 02:45
-
-
Save thefrosty/6645a2b4085be81c12d3 to your computer and use it in GitHub Desktop.
Check post type before modifying upload directory in EDD FES (v2.2.9.5).
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
$override_default_dir = apply_filters('override_default_fes_dir', false ); | |
if ( function_exists( 'edd_set_upload_dir' ) && !$override_default_dir ) { | |
add_filter( 'upload_dir', 'edd_set_upload_dir' ); | |
} | |
else if ( $override_default_dir ){ | |
add_filter( 'upload_dir', 'fes_set_custom_upload_dir' ); | |
} |
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
if ( ! empty( $_REQUEST['post_id'] ) && 'download' == get_post_type( $_REQUEST['post_id'] ) ) { | |
$override_default_dir = apply_filters('override_default_fes_dir', false ); | |
if ( function_exists( 'edd_set_upload_dir' ) && !$override_default_dir ) { | |
add_filter( 'upload_dir', 'edd_set_upload_dir' ); | |
} | |
else if ( $override_default_dir ){ | |
add_filter( 'upload_dir', 'fes_set_custom_upload_dir' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment