Tagged Questions
0
votes
0answers
23 views
How to upload images using <form> as a post thumbnail?
In my custom image upload form, codes are (generally):
if(isset ($_POST['submit'])=='Submit')
{
$product_image_1=$_POST['product_image_1'];
$product_image_2=$_POST['product_image_2'];
$newPost = ...
0
votes
1answer
35 views
How to add filetype to meta value when using wp_upload_bits?
I've set up a custom post type and would like to have the ability to attach files to those posts. I've got the CPT and metabox set up, and the upload function as well.
When I display the CPT on the ...
0
votes
0answers
67 views
Make Add media button accessible to all in front end
I am trying to add an interface in which any user(including non logged in) can create a post from the front-end. I am able to bring the default wordpress editor to front-end using the wp_editor ...
0
votes
0answers
31 views
Custom post types images go to a specific folder, not the montly one
I have a website which allows "mini sites", meaning custom post types.
We noticed that the images that are published along the mini-sites reviews go automatically to the same month, while regular ...
0
votes
1answer
41 views
Upload unnattached image from frontend
I am using the below function to let users upload files from the front end. It works great except that I would like the file to NOT be attached to any post. Currently, the file is automatically ...
1
vote
1answer
50 views
Rename attachments during upload
Here's the function I use for WP to rename images during upload on the fly and set the image's filename to match the post slug.
function wpsx_5505_modify_uploaded_file_names($arr) {
// Get the ...
2
votes
0answers
204 views
Saving images from Gravity Forms repeatable File Upload as post attachments
I am trying to upload multiple images as attachments to a post using Gravity Forms and the Gravity Forms + Custom Post Types plugin.
I have a repeatable File Upload field using the Gravity Forms ...
1
vote
0answers
80 views
How to edit attachment with media-upload.php?
I'm looking to edit an attachment and I'm trying to supply a link to the existing preview image.
<a href="media-upload.php?type=image&TB_iframe=true&" class="thickbox" title="Edit Image" ...
1
vote
1answer
396 views
Saving Custom Field in Attachment Window in WordPress 3.5
I'm using the code below to add a custom text field in WP 3.5 Attachment Window (from this question # Expanding new Media Uploader in WordPress 3.5) ...
add_filter( 'attachment_fields_to_edit', ...
0
votes
0answers
35 views
How to disable parent post in Wordpress
Wordpress associates an image with a post, which is great when it's used for only one post as it will therefore remove the image if the post is deleted, keeping the files and database clean.
However, ...
1
vote
1answer
98 views
problem in uploading attachment to custom directory
i have been trying to upload the attachments to the custom directory without affecting the old uploads. so i use this bellow code to achieve that
add_filter('wp_handle_upload_prefilter', ...
1
vote
0answers
123 views
Upload iPhone video clips to blog via native WP app
I'm using the WordPress iPhone app, and when I upload video clips to a blog they show up in some browsers and in others not. I'm using a HTML5 video markup as a container for the clips. While mpeg-4 ...
0
votes
1answer
82 views
Images not being generated at correct size
I have my WordPress Media settings set like so. Based on these settings no generated large image should exceed the width of 540px.
I embed an image in a post like so. I choose "Large" as a image ...
0
votes
1answer
80 views
is it possible to force wordpress to always save thumbnails as 'jpg' not 'png'
I cant see any settings and cant see much in the php api docs regarding this?
for instance if the original file upload is a png wordpress converts to jpg
1
vote
1answer
75 views
media_sideload_image with rewritten urls?
When I try to use media_sideload_image with a path like this http://placekitten.com/300/200, it gives me an error.
That is because it don't know the filetype or the filename. Best way to upload the ...
0
votes
1answer
109 views
Loop issues when creating custom query for media uploader
I'm working on a theme for a magazine publisher who routinely deals with a large number of images. I need them to be able to associate each image with a contributor (photographer, illustrator, artist, ...
0
votes
1answer
472 views
WP_Query: attachment image in “full” size?
I'm using the following script for my current project.
$query_images_args = array(
'post_type' => 'attachment',
'post_mime_type' =>'image',
'post_status' => 'inherit',
...
0
votes
2answers
4k views
How to Fix HTTP Error When Uploading Images?
I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X
When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a ...
1
vote
1answer
66 views
How to manage a big collection of files with wordpress?
I have a collection of nearly 3000 swf files that will be used in some of WP's post. Two options that I can think of--
Upload them to WP Media Library,they'll become attachments, I can
query ...
0
votes
1answer
173 views
Insert attachments from custom uploader into post (regular uploader style)
I recently started using this nifty meta box framework:
http://www.deluxeblogtips.com/meta-box-script-for-wordpress/
I really like the plupload meta box, however, I need to be able to add the ...
2
votes
1answer
617 views
Uploading Multiple Attachments From Front-End With A Description
I am working on a Wordpress site that has a custom front-end submission form for adding in a post of content type, 'sketchpad'. The form has a section that allows you to upload multiple images with a ...
1
vote
1answer
401 views
How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
I'm developing a simple "member's only" section within a website, with the sole intention of allowing the client to post files for their members. I've come to realize quickly that the posts' ...
2
votes
2answers
299 views
Getting ID from ajax response of async-upload.php
Its a wordpress+jQuery question. Can't post it on stackoverflow because i believe it involves wordpress knowledge too.
What I am trying to achieve:
I am attaching the wordpress async media uploader ...
0
votes
1answer
256 views
How do i save and retrieve custom attachment meta?
I'm trying to save if a checkbox inside of the media uploader pop up is checked, so i can retrieve it from the front end.
I'm using this code:
function filter_attachment_fields_to_edit( ...
0
votes
1answer
851 views
Creating a multi-file upload form on the front end for attachments
I am trying to create a public form where users can upload multiple images to be attached to a particular post. I am able to get it to work with single images thanks to this post at Golden Apples ...
0
votes
1answer
236 views
Get attachments by user
Is there a way to get attachments by user? I need a way to display all the images uploaded by a specific user. (I probably need the attachment IDs so that I can use wp_get_attachment_url to display ...
0
votes
1answer
439 views
How to retrieve alt attribute for an attachment (uploaded image)?
I have some IDs of attachments (images, not from current post). How to I get the alt attribute for those images?
I have tried to look into wp_get_attachment_image_src and wp_get_attachment_metadata ...
1
vote
1answer
607 views
media_sideload_image file name?
I'm using media_sideload_image to download images from the web and store them. However, the problem is that the ones from youtube are always called "hqdefault.jpg", which means that it will override ...
3
votes
3answers
1k views
Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
Is there a built-in feature or plugin that allows you to attach a document to a post or page such that the actual attachment file is one thing (eg a PDF) but the thumbnail images are another (eg a ...
0
votes
2answers
740 views
Insert attachment ID in custom field from media uploader
This is what I want to do:
In the media uploader, add a link "Use this attachment ID as custom field".
Add the attachment ID in a custom fields meta box.
I've searched for hours for a plugin that ...
1
vote
1answer
237 views
Handling image uploads without thickbox
Ideally what I'd like to do is hand a file to a function that returns the file as an attachment of the current post. Just as though it had been uploaded via the thickbox media uploader, but without ...
0
votes
2answers
2k views
Automatically wrap post image in div
In regards to image attachments inserted into a post, I would like to wrap the img tag inside a div tag for specific design purpose.
Is there a way to do this automatically after attaching the image ...
3
votes
1answer
2k views
media_sideload_image generates blank?
I'm creating a custom post form that is supposed to take an external image and uploads it to the media library and attach it to that post. This should be possible by using media_sideload_image, but ...
0
votes
1answer
268 views
Upload attachment from external site
For example, we have some image on the external site:
http://site.com/image.png
How do I upload this image to my wordpress as an image attachment by php?
Image should be copied to my uploads ...
4
votes
5answers
4k views
Disable image attachment links
Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it's possible to do it manually when you add an image to a post but I want to disable this ...
1
vote
2answers
2k views
How to add media from front-end to an existing post?
Golden Apples Design created (as far as I know) the media upload function that many people on WP.A and elsewhere seem to recommend. But all of the Q&As I can find on StackExchange deal with ...
2
votes
4answers
3k views
How to restrict access to uploaded files?
I have a restricted area on a website that can only be accessed by logged in users. Fot that I created a page template with a 'current_user_can()' condition.
My problem is that the documents attached ...
6
votes
3answers
11k views
Submit post and upload image from front-end
I am trying to do something similar to the above question. I am trying to make users post and upload images from front-end. I have already done the post form and its working.
I just followed and ...
1
vote
1answer
834 views
exposing attachment uploading to the front end — delicate
i'm probably breaking a few common sense rules here.
is there a way to utilize wordpress' bake in attachment file handling for
an upload form within a theme
template? yes, the front end -- i ...
1
vote
1answer
801 views
How to delete orphan attachments?
I've been given the directive to "retire" about 1000 articles from a wordpress site I maintain. Deleting the posts from the DB is trivial, but how would one go about deleting the orphaned files from ...
7
votes
2answers
3k views
How does WP media uploader create the 3 different sized images, and how can I duplicate it
I have finally!! got this thing I've tried about 12 times to make and 12 different ways, but finally got it to work,... sort of.
I made a custom metabox for uploading and attaching images to posts, ...
