Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi,

    I added the following code at the end of my theme functions.php :

    add_action( 'fu_after_upload', 'my_fu_after_upload');
    
    $varPath='varPath not attributed yet';
    
    function my_fu_after_upload( $attachment_ids) {
        global $varPath;
        foreach( $attachment_ids as $aid ) {
            $varPath= get_attached_file( $aid );
        }
        return $varPath;
    }
    
    echo('filepath value = '.$varPath.'   ');

    But I still can’t see the path of the file. I’m in fact not sure at all that the function my_fu_after_upload is called after the upload.

    I use the success_page shortcode and I would like to execute an other plugin using the variable $varPath corresponding to the path of the file we just uploaded.

    Do you see where I made a mistake ?

Viewing 1 replies (of 1 total)