Skip to main content

Questions tagged [filesystem-api]

Filter by
Sorted by
Tagged with
0 votes
1 answer
97 views

temphangle variable missing when using wp_filesystem copy

I get the following error when using $wp_filesystem->copy(); to copy a file from one destination to another. Undefined variable: temphangle in <b>../htdocs/wp-admin/includes/class-wp-...
RafaSashi's user avatar
  • 497
0 votes
1 answer
195 views

Does WordPress still ask for FTP credentials for each file operation?

There is a reply from 2014, that is a great answer to a question I have, but WordPress changes, and I'm wondering if this is still true, "WP Filesystem API will ask for FTP credentials, but it will do ...
Nora McDougall-Collins's user avatar
2 votes
1 answer
1k views

How to append_contents using WP_Filesystem?

I have scenario that appends the contents into the files, I was using normal file system function of PHP Now I have decided to use WordPress WP_Filesystem but I cannot see any methods of it which do ...
Thamaraiselvam's user avatar
0 votes
1 answer
2k views

Right way to download file from source to destination

I'm trying to download a file from one location to another. The code is working perfect. Here is the code snippet: Helper Function - Create directory in /uploads/{$dir_name}/ and return paths. /** * ...
maheshwaghmare's user avatar
0 votes
1 answer
302 views

Should I use Filesystem API for reading files or listing directories?

I know that i should use Filesystem API to write files and I understand why but is there any difference if I read file with wp_filesystem or plain PHP? And what about listing directories? Consider ...
Mateusz Marchel's user avatar
6 votes
1 answer
911 views

Why doesn't WP_Image_Editor save images using the Filesystem API?

I was in the process checking some of my existing plugins for any unsafe filesystem accesses, when I ran across WP_Image_Editor's save function, which calls _save, which finally calls make_image (...
Dan's user avatar
  • 897
3 votes
1 answer
1k views

How to set path with WP_Filesystem and ftp base / chroot

In my theme i will use the WP_Filesystem to write a file to for example: $file = get_template_directory().'/library/assets/css/wpless2css.css'; Which outputs something like /home/user/domain/...
Bass Jobsen's user avatar
1 vote
0 answers
476 views

Is there function similar to wp_upload_bits() that will allow uploading to a specific path?

wp_upload_bits() allows you to put arbitrary binary data into a file, but it selects the path where the file is placed and doesn't allow configuration of this destination besides the basename. There'...
Dan's user avatar
  • 897