I'm trying to get html file content in wordpress admin side, and I've tried simply file_get_contents
but it doesn't works correctly in some wordpress versions. Then I found wp_remote_get
function; this one works correctly but wp_debuger
noticed error:
Strict standards: Only variables should be passed by reference
So how do I simply give html file content to variable? Thanks in advance.
I have tried:
$template=wp_remote_retrieve_body(wp_remote_get(get_template_directory_uri().'/admin/templates/settings.htm'));
Filesystem API: The Filesystem API abstracts out the functionality needed for reading and writing local files to the filesystem to be done securely, on a variety of host types.
Check references: Filesystem API