3
votes
1answer
157 views

Modify image while uploading

I have a plugin which uploads image using wp_upload_handler here is a function: //handles upload, a modified version of bp_core_avatar_handle_upload(from bp-core/bp-core-avatars.php) function ...
1
vote
1answer
223 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
1
vote
2answers
513 views

Custom image upload

I'm trying to setup upload for for attachments for my custom post form. At first I add to my form tag enctype="multipart/form-data" For testing purposes I have two upload forms, but in future I'm ...
2
votes
1answer
1k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
4
votes
2answers
1k views

How to change upload directory in wp_handle_upload

I am trying to work out how to use the wp_handle_upload function for a custom plugin so that i can specify my own own upload directory. The code so far takes a file from my plugin settings page and ...
1
vote
1answer
3k views

wp_handle_upload - The uploaded file could not be moved to wp-content/uploads/2012/09

This is the code I am using to upload the file to WordPress define(‘WP_DEBUG’, true); $filename = "test.png"; $tmpFile = download_url("http://url.com/testing/crop/".$filename); chmod($tmpFile, ...