The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
19 views

Using 'add_attachment' to add taxonomy term on upload completion?

function amend_gametitle_upload( $game_title ) { global $post; if ( isset( $_REQUEST['post_id'] ) ) { $post_id = absint( $_REQUEST['post_id'] ); $post_obj = get_post( ...
1
vote
0answers
44 views

capability for upload on front-end (An error occurred in the upload. Please try again later )

We have a front-end form with wp-editor on front-end template page. Everything is working fine. but the only problem is "we can't add new images on front end form". there is an error "An error ...
0
votes
1answer
253 views

How to upload multiple images on frontend to ACF gallery using update_field

I'm trying to save images submitted on a frontend form in a way that they are accessible via the ACF backend. In how to upload an image on ACF with update_field on wordpress, someone provided a ...
0
votes
0answers
53 views

using media_handle_sideload() to add mp4 files to Media Library

For a site I'm building (for a client), I've written a shortcode, where the poster can enter [vine id="..."] followed by the ID of a Vine video. When the post is saved, my PHP functions will then go ...
-1
votes
1answer
105 views

wp_handle_upload Image sizes

What's the simplest way of getting wp_handle_upload To either change the size of the image it is uploading, or to get WordPress to generate the 3 sized images like it does in "crunching" when adding ...
0
votes
0answers
49 views

Wordpress will suddenly stop saving files uploaded by my code (ran in nopriv ajax)

I have some code that uploads a file. I've tried both wp_handle_upload as well as regular PHP code and with both, it will claim it uploaded the files (wp_handle_upload returns an array with "url" and ...
0
votes
1answer
63 views

Upload file without attaching it to a POST

I've brought files with html file field and I'm trying to attach file to wordpress attachments using media_handle_upload $attach_id = media_handle_upload ( $file_handler, null ); the I've specified ...
0
votes
2answers
224 views

How Can I pass an image file to wp_handle_upload?

I have been looking everywhere for this and havent been able to find an answer. I need to pass a file from the url source to wp_handle_upload. How can I accomplish this? Thank you
0
votes
1answer
128 views

wp_handle_upload() - how to upload to a custom subdirectory within uploads

wp_handle_upload() works for me, but uploads files where it wants (uploads/year/month). Question: Is there any way to tell it to upload files to a custom dir (uploads/mycustomdir)? Or is there some ...
1
vote
0answers
109 views

wp_handle_upload: get custom checkbox value from media uploader

I found a snippet to add a checkbox to media uploader using action post-upload-ui Snippet found here /** * Add checkbox to set autocreate on upload */ function ...
0
votes
0answers
30 views

What kind of security does wp_handle_upload() provide?

According to the docs, wp_handle_upload(), will: Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type, and moving the file to the appropriate directory within ...
0
votes
0answers
42 views

Wordpress CPT Upload Audio Files to wp-content/upload/audio

I'm working on a custom post type for my blog that will read files in the directory specified and create a post for that file. I also want to use the wp upload handler in my custom post type but I ...
0
votes
1answer
92 views

upload file with front-end submission and forward the data in an email

I have an email set up using wp_mail that forwards my front-end submission data as well as posting it to the dashboard. The part that I am having trouble with is forwarding the attachment file with ...
2
votes
1answer
359 views

Image resize with image url

I am using wp_handle_upload() to allow users to upload the images in back-end and I want to re-size images to a custom size before uploading it. Is there any way without using any plugins or so to ...
1
vote
0answers
67 views

Frontend image uploading from frontend cant handle hebrew names

i'm using the insert_attachment code in my functions.php : function insert_attachment($file_handler,$post_id,$setthumb='false') { // check to make sure its a successful upload if ...
3
votes
1answer
207 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 ...
0
votes
1answer
67 views

Image upload and crop in wordpress

I am new to wordpress and buddypress plugin. I want image upload and crop functionality in a new page. How can I do this. I searched over the internet and couldn't able to find a tutorial to do this. ...
0
votes
0answers
53 views

custom Image upload coding wordpress

Hello im working on WordPress plugin with separate data tables in same database. so far im doing okay with add new post. I want to add images to my post. I tried many things but so far I've got ...
1
vote
1answer
351 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 ...
0
votes
0answers
72 views

plugin: alter “crunching…” text, reject the upload, and other logic

I am new to wordpress, but a customer wants one of my scripts converted into a wordpress plugin. The basic idea of the script is when a file is uploaded with a specific filetype, then start decoding ...
0
votes
1answer
738 views

wp_handle_upload returns empty error array

I am trying to do an upload via ajax and really dont want to use the regular wordpress media uploader. It is too much stuff and all i want to do is upload single image. I have everything working the ...
3
votes
1answer
473 views

Changing upload directory for plugin uploads only

I've spent a lot of time reading the other threads on this question, but I just cannot get my code to function properly. I'm building a plugin, and I've set up an upload form on my custom admin page, ...
0
votes
1answer
167 views

WordPress front-end media (image) upload ERROR!

I pasted my codes HERE in Pastebin. Thing is that, I have posts, where the post thumbnail is the first image and the custom fields are used to store the other 3 images of the post. The form fields ...
0
votes
1answer
211 views

Specified file failed upload test. Error When Uploading Image From Front-end

This is my code: $file_return = wp_handle_upload($_FILES['my-photo'], array('test_form' => FALSE)); if(isset($file_return['error']) || isset($file_return['upload_error_handler'])) { echo "And ...
0
votes
1answer
235 views

How to use getimagesize() of image upload?

I need to check the resolution of an image I want to upload via media box, and then upload it into a custom directory. As a starting point I used part of the code from How Can I Organize the Uploads ...
1
vote
2answers
671 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 ...
1
vote
0answers
212 views

Upload video in custom folder

I am trying to find a system to upload some kind of media in a custom folder. I want to keep all uploads in default wordpress folder and create a custom folder just for videos. So i would have the ...
2
votes
1answer
458 views

rename attachments based on parent-post-title on upload

I know there a some functions already avaible here for this task, but none of them seem to work as needed. The best way seems to me adding a filter to wp_handle_upload_prefilter like kaiser does in ...
0
votes
1answer
609 views

Upload an image at frontend > Create direction and/or rename filename possible?

I have a form for a non-profit-club, that publish posts + up to 20 images. The image-path will be writen in a custom-field. Images are uploaded. Ok, now i want to rename the pictures or (much better) ...
0
votes
1answer
493 views

Image upload and path to custom field

I build a script, to post from frontend. There are many custom-fields. Most works fine, but with one thing i have problems. First a description, then the script. It seems like, that images won't ...
2
votes
1answer
2k 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 ...
1
vote
1answer
442 views

Organizing uploaded media with wp_insert_post() and wp_handle_upload according to time parameter

I'm retroactively creating a post with wp_insert_post() and attaching a featuring image to it. I need the image to go into the folder that corresponds to the post's publishing date. I'm using time ...
0
votes
1answer
872 views

Using wp_handle_upload and media_handle_sideload with ajax

I'm struggling to figure out how to use wp_handle_upload() with ajax when processing a form. What I'm doing here is using a form to allow users to edit posts from the front end so they can do some ...
4
votes
2answers
2k 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, ...
1
vote
1answer
570 views

Upload images with comment

EDIT: I finally got the right answer; see my own answer beneath this post for everyone that's interested. After searching for a couple of days and trying over and over again I really got stuck. ...
1
vote
2answers
858 views

Disable image resizing on specific upload fields

I am using the Options Framework Theme from devinsays, but am having a "small" problem with the Image Upload functionality. Basically, I need to disable resizing on a specific upload-field, but keep ...
2
votes
2answers
2k views

How to set file type in wp_handle_upload?

I'm using wp_handle_upload to allow users upload .csv files in the front end and it's working fine. I was wondering how can I limit this to only allow .csv files though since currently it accepts a ...