• Hello,
    I added this code to the functions.php:
    ==============================================================

    add_filter("gform_upload_path", "change_upload_path", 10, 2);
    function change_upload_path($path_info, $form_id){
    global $current_user;
    get_currentuserinfo();
    
    $path_info["path"] = "C:/xampp/htdocs/mysite/upload-folder/test/" . $current_user->user_login . "/";
    $path_info["url"] = "http://localhost/mysite/upload-folder/test/" . $current_user->user_login . "/";
    return $path_info;
    }

    ==============================================================

    when I add: custom filed -> Field Type: “file upload” and Custom Field Name: “existing” – everything works fine: files go to this folder:
    http://localhost/mysite/upload-folder/test/admin
    ( where “admin” is eg. of user login).

    But when I add: image -> Set as Featured Image, my files goes to this folder:
    1) http://localhost/mysite/upload-folder (so, this is path define in wordpress “general optin”->”media”, not from my function)

    and here:
    2) http://localhost/mysite/upload-folder/test/admin

    (So, there is 2 copy of this one image.)

    But image set as “featured image” unfortunetly come from first path.

    I want to send files to the same folder as in the previous case.
    Any ideas?
    I will be grateful for the quick response.

    http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/

The topic ‘Upload path doesnt work for featured image’ is closed to new replies.