get_home_path() returning error 500

I’m using get_home_path() because i need to store a file from a temporary directory to an archive folder (i’m doing this using php’s copy() function).

The problem is that get_home_path() returns me an error 500 (internal server error). If i comment that function, the script works.

Any idea on why is this happening?

UPDATE as per s_ha_dum’s request

here’s the debug log:

[09-Jul-2015 07:36:44 UTC] PHP Fatal error: Call to undefined
function get_home_path() in
/www/ggp.com/wp-content/themes/ggp/functions.php on line 649

UPDATE: my code

function save_sent_mail_function() {

    [...]

        $home_path = get_home_path();

        $cvs_path="/wp-content/uploads/cvs/".$file_name;

        copy($file['cv'], $home_path.$cvs_path);

    [...]

}
add_action('wpcf7_mail_sent', 'save_sent_mail_function');

I found out that there’s the ABSPATH constant that i can use instead of the $home_path variable

0

Leave a Comment