Hey guys,
I would have replied to the previous thread, but it was closed...
I'm trying to hijack the form POST to change the file upload path of one field. Just before submission, I can get the path to change properly, but I'm assuming after it posts, the upload path is hijacked again by the form.
Here's what I have so far:
add_action('gform_post_data_1', 'ebooks_review_book', 10, 2);
function ebooks_review_book($form) {
$img = $form['images'][0]['url'];
$img = explode('/', $img);
$img = $img[sizeof($img)-1];
$form['images'][0]['url'] = content_url() . '/uploads/books/' . $img;
echo "<pre>";
print_r( $form );
echo "</pre>";
exit;
//return $form;
}
Is there a hook I can use to make this work? One that runs after change_upload_path
, but before the file is actually moved?
Thanks,
jacob