2019-02-22, 21:17:26
I'm curious and maybe I've just missed something but when I try to use get_theme_url as part of the file path I can't write to file, however when I use a relative path then all works fine.
It's Friday, it been a long week so maybe I'm just missing something stupid. Just wondered if anyone had an idea.
Absolute path - Used within a file in the theme folder:
And yet if I use the relative path without including the function 'get_theme_url()', all works fine.
It's Friday, it been a long week so maybe I'm just missing something stupid. Just wondered if anyone had an idea.
Absolute path - Used within a file in the theme folder:
Code:
$dataStr = "testing 123";
$fpath = get_theme_url(false)."data33.txt";
file_put_contents($fpath,$dataStr);
And yet if I use the relative path without including the function 'get_theme_url()', all works fine.
Code:
file_put_contents("theme/helpdesks/data33.txt",$dataStr);