Upload path change
-
So i’m changing the upload path in a gravity form through a hook. This works perfectly when used normally but if the form is in an inline fancybox it doesn’t work. It just gets stuck uploading.
I know the code to change the path is correct. Fancybox is interfering in some way.
Any ideas?
the code i’m using to change the path in funtions.php is:
add_filter( 'gform_upload_path', 'wdw_change_upload_path3', 10, 2 ); function wdw_change_upload_path3( $path_info, $form_id ) { if ($form_id == 9 ){ $page_id = get_the_ID(); //get Paciente Info $row13=$wpdb->get_row("SELECT nombre, apellido1, apellido2, clienteID FROM siodental_com.Paciente WHERE pageID='$page_id'"); $nombre = $row13->nombre; $apellido1 = $row13->apellido1; $apellido2 = $row13->apellido2; $clienteID = $row13->clienteID; $upload_dir = wp_upload_dir(); $path_info['path'] = $upload_dir['basedir'].."/Subidas_cliente/$clienteID/$nombre"."_".$apellido1."_".$apellido2."/"; $path_info['url'] = $upload_dir['basedir']."/Subidas_cliente/$clienteID/$nombre"."_".$apellido1."_".$apellido2."/"; } return $path_info; }The code I’m using to call the fancybox is:
//Upload more pics echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-3">'; echo do_shortcode('[gravityform id="9" ajax="true"]'); echo '</div></div><a href="#fancyboxID-3"><input class="button small default comment-submit blue" name="submit" type="submit" id="submit" value="Subir mas fotos"></a>';
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘Upload path change’ is closed to new replies.