wp-content/uploads/
should be writable for the server (otherwise it would be impossible to upload a file, no?). If you are going to create something under this directory, it is safe to use wp_mkdir_p()
.
I would only use WP_Filesystem
if there is a chance the server does not have permissions to write to the location, like in wp-content/plugins/
, which does not have to be writable for the server (at least I think it doesn’t have to be?).
Sidenote: The File Permissions page of the Codex also talks about a wp-content/cache/
directory. Would this be a “more standard” location for cache files?
Related Posts:
- Convenient way to use wp_filesystem
- Converting fopen/fwrite operations to WP_filesystem
- What dependencies should I load and to use the WP_Filesystem?
- temphangle variable missing when using wp_filesystem copy
- Should I use Filesystem API for reading files or listing directories?
- Does unzip_file() over-write by default?
- Is there a WP Way of getting a filehandle?
- Moving wp-content outside of web root?
- $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
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Relative file paths in CSS when linking directly (not enqueuing)
- Is fopen() forbidden in WP?
- How to check if txt file exists inside template folder?
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- Is it bad to store many files in a single folder?
- External pages redirecting back to wordpress
- WordPress Login doesnt respond after using Filezilla to upload my files on the server
- List of files/folders writable by the web server?
- Save PDF File From Plugin to Filesystem /wp_upload
- accessing files in custom folder in wordpress
- How to replace file_get_contents() with a WordPress Filesystem call
- What files are safe to delete after a security breach in WP content folder?
- Running rmdir function on post save
- WordPress Creates Unused (Unregistered) Image Sizes
- Failed opening required
- Right way to download file from source to destination
- Correct file permissions for in-browser updates using WP-CLI
- WordPress installation on digitalocean eating the server storage
- How to prevent users to view server files using WP File Manager plugin?
- Serve contents from Nextcloud / WebDAV
- File ownership for file tree php user ID – Folder permission 775
- How to write to a text file and save it in a folder for later download?
- 403 Error on “/”
- Get names and paths from unzip_file()
- Downloadable content file structure
- saving file to external server vip
- Time limited file download upon form submit
- How do I upload my WordPress code files from previous website onto local host WordPress website?
- WordPress – tracking options
- Where to store PHP files created by plugin / themes
- How to give image source in wordpress page editor?
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- Copy and delete a directory with WordPress functions
- How to configure WP filesystem access in Linux (Ubuntu Server)?
- How to fix the error “file_get_contents was found in the file functions.php”?
- How do you use unzip_file()?
- Merging PHP download script into `functions.php`
- Uploading non-media files?
- Unable to access WP admin
- wp_temp_dir does not change the /tmp temporary default directory
- wp-config.php file permissions
- Standard permissions for wordpress; Plugin installation asks for FTP credentials
- What to use , set_transient, set_option or file system? [closed]
- Convert PHP readfile to WP_Filesystem
- Can’t write pdf file to upload directory using FPDF
- Change default uploads file using wp Skeleton
- Installation failed: Could not create directory – CentOS 7
- Register visits of my pages in wordpresss
- Adding Adobe files to a wordpress site [closed]
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- How to know which ajax file or function is called for action
- Running WordPress as FTP user?
- why there is a large file named core in wpmu’s directory?
- Can WP plugins access files outside the installation folder?
- Is it better to store images and other files in the root directory or the theme directory
- Theme, WordPress Version, MySQL Version, PHP Version Update affected files and folders
- Does WordPress create a new Linux user when creating a new WordPress blog?
- How to move core js files into the footer
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Should I store critical css in the database or in my theme’s filesystem?
- Look for a file in a theme before loading from plugin
- get_template_directory() returns wrong address on VPS
- WP_Filesystem in custom customize control
- Upload PDF and other files from the Front-End
- Submitting form from input[type=file] dialog box
- Save media files (images) to database instead of the filesystem
- How to Copy Upload Image using WP_Filesystem_Direct
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- How to upload .tex files in wordpress?
- Need folder for CPT templates for eg: single-{post_type}.php
- Change default wordpress FS owner
- Media Upload to custom database and Custom Directory
- trying to locate the correct file to edit my internal linking anchor tags
- Can’t Install WordPress (local) Failed to open file wp-includes/wp-db.php
- Error Copying Directory On Plugin Activation
- Avoid ‘uploads’ 777 permissions: Potential threat or clean solution?
- WP_Filesystem usage within a block of code
- version control for wordpress? (wordpress folder and database at same time)
- Private file system for attachments
- Folder Permissions + Security Concerns
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- No error in debug mode, wordpress template can not be loaded
- Download a zip folder of selected files
- File doesn’t exist! in wordpress function.php file while creating new post or page
- WordPress files owner changed silently
- How can I get blog content from SFTP?
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [closed]