Hi Carl,
that's strange. My standard path looks like this:
/html/landwire/wp-content/uploads/gravity_forms/4-8bce87129732fcf2d740bba2abb15260/2011/11
I have the latest GF 1.6.1 and WP 3.2.1 installed. Should the "form" folder look like this with all those numbers (4-8bce....)? As you see the 2011/11 gets created by GF. I checked that on a clean install of GF and WP - no other plug-in installed. As soon as you use the "gform_upload_path" filter the 2011/11/ is not created anymore. In the meantime I figured out how to get the 2011/11 back. I have one problem though:
how can I get the form title in this function, where I create the folders based on role and username:
add_filter("gform_upload_path", "change_upload_path", 10, 2);
function change_upload_path($path_info, $form_id){
$currentuserrole = get_current_user_role();
get_currentuserinfo();
$currentusername = $current_user->user_login;
$path_info["path"] = "/home/www/web116/html/landwire/gf_submissions/$currentuserrole/$currentusername/";
$path_info["url"] = "http://www.landwire.de/gf_submissions/$currentuserrole/$currentusername/";
return $path_info;
}
I tried:
$form = self::get_form($form_id);
$title = $form->title;
But that will not work.
I also need to retrieve the Post Title (when I am using post fields). Any ideas how I can achieve this within my "change_upload_path" function above?
Posted 13 years ago on Tuesday November 22, 2011 |
Permalink