Last active
January 13, 2022 13:14
-
-
Save champsupertramp/7282a8a32a3e8ff70e0d24dc777e4705 to your computer and use it in GitHub Desktop.
Ultimate Member - Make UM Files Field including cover and profile photos syncronized
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
add_filter("upload_dir", function( $upload ){ | |
if( ( isset( $_REQUEST['action'] ) && ( "um_resize_image" == $_REQUEST['action'] || "um_imageupload" == $_REQUEST['action'] ) ) || isset( $_REQUEST['um_action'] ) ){ | |
$upload['basedir'] = str_replace( "/sites/2", "", $upload['basedir'] ); | |
$upload['baseurl'] = str_replace( "/sites/2", "", $upload['baseurl'] ); | |
} | |
return $upload; | |
}); | |
add_filter("um_change_upload_user_path","um_011321_change_upload_user_path", 10, 3 ); | |
function um_011321_change_upload_user_path( $arr, $field_key, $field_type ){ | |
$arr[0] = str_replace( "/sites/2/", "/", $arr[0] ); | |
$arr[1] = str_replace( "/sites/2/", "/", $arr[1] ); | |
return $arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment