In the functions.php I included an file called ThemeOptions.php where I load options and generate the custom css. I did it very simple with file_get_contents, fopen and fwrite. Of course this approach triggered several warnings in Theme Check and thats why I am trying to implement in ThemeOptions.php the WP_Filesystem approach.
At the moment I get an ugly error from the site :Fatal error: Call to undefined function WP_Filesystem() in , and from what i understood its because i call WP_Filesystem outside WP_admin.
Is there any way of calling WP_Filesystem from outside WP_admin ? More specifically from a file included in functions.php ?
Thank you
use require_once(ABSPATH . ‘wp-admin/includes/file.php’);