## php – How to automatically convert images to WebP on WordPress?

Question
Doing this in vanilla WordPress using hooks requires code that hasn't been released yet, specifically: That Trac ticket adds new filters which are available in WordPress 6.1. Note that if your server cannot process webp images for resizing then webp will no
0
3 weeks 0 Answers 0 views

## uploads – How to parse an image that was just uploaded to make sure it doesn’t contain malicious code?

Question
Let's assume that an user has just uploaded an image. How do we make sure that the image doesn't contain hidden PHP code that will run once the image is on the server? The most common (and, for practical purposes, the only one) attack pa
0
3 weeks 0 Answers 0 views

Question
I have a requirement, for that, I have to change a CPT's upload folder, which I have achieved by the following code. add_filter( 'wp_handle_upload_prefilter', 'rsg_pre_upload' ); function rsg_pre_upload( $file ) { add_filter( 'upload_d 0 3 weeks 0 Answers 0 views ## Can’t Access File in Root-Directory Question I've been trying to get my favicon to work on Apple devices. Therefore, I've placed several PNG-files in my root-directory (screenshot attached). While I can access most of them just fine by entering my website name followed by the file name (e.g. 0 2 months 0 Answers 0 views ## How do I upload file through custom field, save it to database and get it Question I have made a custom field without any plugin. When I choose file I want to upload that file and get its url on my page. Basically, I want to upload video and show it on frontend. This is my code right now (its just good for text, not upload file): 0 3 months 0 Answers 0 views ## ajax – Why is the file not uploading to the server? Question On wordpress page i am using inline vue, because form is too complex. let formData = new FormData(); formData.append("action", "topcare"); formData.append("nonce", true_object.nonce); formData.append("a 0 4 months 0 Answers 0 views ## uploads – I want to create a file storage system for different clients using plugins Question uploads - I want to create a file storage system for different clients using plugins - WordPress Development Stack Exchange 0 4 months 0 Answers 0 views ##$file[‘error’] except if

Question
Only administrators can upload images to the site. EDIT: However, the author can create a page and when he creates it, I want to allow him to upload, but only then. function tomjn_only_upload_for_admin( \$file ) { if ( ! current_user_can( 'manage_options' ) ) {
0
4 months 0 Answers 0 views

## Cant upload larger than 100MB

Question
I am using DO Droplet 2gb RAM Shared CPU running apache. I cant upload files larger than 100MB in the Media Uploader but I can upload LOWER than 100mb. I already tried modifying php.ini and other stuffs like htaccess and wp-config. @ini_se
0
5 months 0 Answers 0 views