Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/7282a8a32a3e8ff70e0d24dc777e4705 to your computer and use it in GitHub Desktop.
Save champsupertramp/7282a8a32a3e8ff70e0d24dc777e4705 to your computer and use it in GitHub Desktop.
Ultimate Member - Make UM Files Field including cover and profile photos syncronized
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