Forked from spivurno/gp-media-library-set-upload-directory.php
Created
April 3, 2020 19:03
-
-
Save version-control/78c66577b2bafd41179edd50131a9026 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