I had to dig pretty deep for this too, and eventually figured out some way to do this.
in my solution I used the following:
WP_Filesystem();
global $wp_filesystem;
$wp_filesystem->exists( '/path/to/file' ); //use any other functions available in the Filesystem API: @see https://developer.wordpress.org/reference/classes/wp_filesystem_direct/
Related Posts:
- Call to a member function put_contents() on a non-object
- Copy a file from a plugin into my theme directory
- How do you use unzip_file()?
- How to append_contents using WP_Filesystem?
- When to use the Filesystem API? Should I use it at all?
- Why my wordpress blog files are getting changed?
- Finding the path of a specific WordPress install
- How to include form for WP_Filesystem()?
- How does WordPress access theme and plugin files through its editor?
- Is there a way to use WP filesystem without credentials when FS_METHOD is NOT set to direct?
- unzip_file not working with the remote file
- How can I add a method to create files when in theme-editor.php
- How to Copy Upload Image using WP_Filesystem_Direct
- Add `manifest.json` file to a Custom WordPress Theme
- How to display dialog box to save file from wp_filesystem->put_contents function?
- Object of class WP_Filesystem_Direct could not be converted to string
- using wp_remote_get instead of file_get_contents [duplicate]
- Creating directory in uploads – wp_mkdir_p() or WP_Filesystem?
- Standard location for plugin to save/cache files?
- How to use WordPress HTTP API to download file from remote location
- wp_remote_get(), downloading and saving files
- Which filters or actions to use after a media upload and delete?
- How to add Request header in WordPress remote api calls
- How to wp_upload_bits() to a sub-folder?
- HTTP digest authentication using wp_remote_get
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- rewrite script to use wp_remote_get instead of file_get_contents_curl
- How to consume and display external data in WordPress from another website
- HTTP request on localhost failing
- Convenient way to use wp_filesystem
- wp_remote_get vs. file_get_contents vs. cURL?
- Copy and delete a directory with WordPress functions
- wp_remote_get – cURL error 28 – only on same domain
- wp_remote_get() not retrieving pages properly
- How to fix the error “file_get_contents was found in the file functions.php”?
- How to get the generated query string of wp_remote_get?
- Can’t access wp_filesystem in cron function
- What exactly does $wp_filesystem->abspath() return?
- wp_remote_get returns an error for valid URL
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Allowing all/different file type uploads
- Moving wp-content outside of web root?
- wp_remote_get vs. fetch_feed ? which is the better for performance?
- $wp_filesystem returns NULL. What are the dependencies?
- How do I edit the php/html for a particular post?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- Unable to access WP admin
- Use WP_Filesystem to list files in directory
- How do I execute a wp_remote_get call using NTLM authentication?
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- wp_remote_get keeps timing out
- Trying to get an api request getting error 404
- What to use , set_transient, set_option or file system? [closed]
- Why cant the WP Filesystem API read googlefonts.json?
- Convert PHP readfile to WP_Filesystem
- Using wp_filesystem in Plugins to store customizer settings
- Use wp_remote_get to add image to media library
- Where is Featured Image code stored in WP?
- how to change max file upload size WordPress 4.9.8 [closed]
- Downloading File from Outside Web Root
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Use wp_remote_get to get JSON instagram feed from public profile
- Creating directory and file using native wordpress file system
- WP_Remote_Get Not working
- using wp_remote_get to retrieve own url on local host
- Relative file paths in CSS when linking directly (not enqueuing)
- Register visits of my pages in wordpresss
- Remove caching from wp_remote_get calls from custom plugin
- Most performant way of fetching remote API data?
- How to Download and install plugin database remotely
- Converting fopen/fwrite operations to WP_filesystem
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- How to check if txt file exists inside template folder?
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- wp_remote_get() and javascript/noscript situation
- wp_remote_get adding backslashes
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- Why WordPress plugin url ajax doesn’t work?
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- How to convert this cURL to wp_remote_*?
- Cannot parse results from wp_remote_get
- Where to write custom logs in WordPress
- wp_remote_get – curl error 28 connection timed out – using SANS in URL
- wp_filesystem put_contents issue with owner/group
- wp_remote_get times out on api request but jquery GET and postman work?
- Copy Folder to another Folder using WP Filesystem
- How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- wp_remote_get sslv3 alert handshake failure
- why there is a large file named core in wpmu’s directory?
- What dependencies should I load and to use the WP_Filesystem?
- How to replace file_get_contents() with a WordPress Filesystem call
- Passing cookies when using wp_remote_get
- Where would I put my call to wp_remote_get?
- Fetching data from another website results in a slow website?
- Errors on a single host using wp_remote_get() unless sslverify is set to false
- Running rmdir function on post save
- How to move core js files into the footer
- http_response_timeout filter not working