Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false

I noticed in your comment… Return the uploaded image ID, so to use to update the ACF field Here is two functions which may help you out… gf_handle_attachments() to handle converting gform submission image file into wordpress media attachment. Returning media (attachment) id. gf_upload_to_media_acf() to handle gform submitted image or multiple images and update defined … Read more

How can I upload an image for background use using the Theme Editor in WordPress?

Giving the CSS of background #FFFFFF url(‘images/newbackground.gif’); is just giving an example based on basic CSS. Be careful when copying the suggestions made in the book because you missed an important colon after background. It should be background: #FFFFFF url(‘images/newbackground.gif’); Also, you need to make sure the URL part of the CSS is correct for … Read more

Randomise upload filenames (or another solution to hide the original image URL from theft?)

Where am I going wrong? Actually, your code is just fine. Except that I would simply use wp_generate_password() to generate the random string. 🙂 WordPress will still think that the scaled version is called painting-scaled.jpg , etc. Resulting in broken images. Yes, that’s correct. Images are stored as posts of the attachment type in the … Read more

Custom “Insert into Post” button

If you want it to show up in the image edit, say next to “insert into post” you will need to hook into attachment_fields_to_edit //for instance add_filter( ‘attachment_fields_to_edit’, ‘yourfunction’, 1, 2 ); Have a look at media.php http://mobile.adambrown.info/p/wp_hooks/hook/attachment_fields_to_edit?version=3.1&file=wp-admin/includes/media.php