Last active
November 10, 2021 19:41
-
-
Save spivurno/2509182e066f9a47cfabf0a671640682 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Gravity Perks // Media Library // Set Upload Directory | |
* http://gravitywiz.com/documentation/gravity-forms-media-library/ | |
*/ | |
add_filter( 'gpml_media_data', function( $return ) { | |
add_filter( 'upload_dir', 'gpml_set_upload_dir' ); | |
if( ! function_exists( 'gpml_set_upload_dir' ) ) { | |
function gpml_set_upload_dir( $upload_dir ) { | |
$upload_dir['path'] = ABSPATH . 'wp-content/uploads/paramountregistry'; | |
$upload_dir['url'] = get_option( 'site_url' ) . '/wp-content/uploads/paramountregistry'; | |
remove_filter( 'upload_dir', 'gpml_set_upload_dir' ); | |
return $upload_dir; | |
}; | |
} | |
return $return; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-media-library/gpml-change-upload-directory.php