An image, audio or a video comprises a media.

learn more… | top users | synonyms

24
votes
1answer
918 views

Pre populate WordPress wp_media modal with image selection

I'm the developer of the Advanced Custom Fields plugin and am hoping you can help me out with an issue I am facing. I have a button where you can edit an image. This button will launch a WP 3.5 media ...
23
votes
9answers
10k views

Restricting Users to View Only Media Library Items They Have Uploaded?

I want users to be able to upload photos using add_cap('upload_files') but in their profile page, the Media Library shows every image that's been uploaded. How can I filter that so that they can only ...
22
votes
4answers
4k views

Add a menu item to Wordpress 3.5 Media Manager

How can add a new menu item underneath the "insert From URL" on the left sidebar in the new Wordpress 3.5 Media Manager? I've been looking at the backbone js and tried my hand at hooking into it with ...
19
votes
2answers
12k views

How to Protect Uploads, if User is not Logged In?

I use wordpress for a private site where users upload files. I use the "Private WordPress" to prevent access in to the site if the user is not logged in. I would like to do the same to the files ...
17
votes
1answer
4k views

How to manage attachment relationships for specific posts in WP 3.5+

In WordPress 3.5, media management has changed entirely. Also, relating attachments to specific posts is (I believe) basically only being done for backward compatibility. Therefore, after uploading ...
16
votes
2answers
3k views

Enhance Media Manager for Gallery

I would like to enhance the Media Editor, after WordPress 3.5, on the gallery view. I want to add a new select field on the right side and send the selected values to the gallery shortcode. I ...
11
votes
3answers
2k views

How Can I Add the “Insert From URL” Tab to a Custom 3.5 Media Uploader?

I've inserted a WP 3.5 media uploader into a widget by running this JavaScript when a button is clicked on: var frame = wp.media( { title : 'Widget Uploader', multiple : false, ...
11
votes
1answer
181 views

Reject upload of wrong-sized images using the Media Uploader

I'm working on a super-strict setting for adding images to Custom Fields in the Post Edit screen. My optimal scenario would be to add a a Custom Error message when the user tries to upload an image of ...
11
votes
2answers
845 views

How to make a image-size selected by default in Media upload - WP v3.5

Bare with me. I want to have a custom image size selected by default in the Media upload popup page. In Wordpress v3.4.2 and prior, this elegant code worked fine: function ...
10
votes
2answers
2k views

ZIP up all images displayed in a [gallery] and offer as download link

I would like to offer my visitors the option to download the entire photo gallery (displayed on dedicated [gallery] pages) as a ZIP file displayed at the bottom of each gallery page. - The full-sized ...
10
votes
4answers
4k views

Cleanup uploads folder, Media Library db structure

I am doing an upgrade and cleanup of an old blog that started on Blogger.com, then moved to self-hosted WordPress 2.1, 2.3 and now 3.0. Images in the posts are scattered around: most of them are in ...
10
votes
2answers
2k views

How can you set maximum width for original images?

Case: I have a client that doesn't know much about the digital world. However what she does know is how to get the photo's from her camera on to the computer and in WordPress. However she doesn't know ...
9
votes
1answer
5k views

Adding Category/Tag/Taxonomy Support to Images/Media

I've been trying to add category, tag, or custom taxonomy support to images (or all media, though I'm only concerned with Images). I've got it part-way figured out with: add_action('init', ...
9
votes
2answers
552 views

Delete an attachment in the WP media modal window

I'm trying to create an option in the WP modal media window to detect duplicate files and delete a newer file if an older duplicate is found. I have the following code working (in conjunction with the ...
9
votes
1answer
2k views

Custom post type with a forced fixed aspect ratio image crop

What I am looking for is similar to a couple other questions. The links are: Creating an Image-Centric Custom Post Type? Using Default WordPress Custom Header Image Crop Feature in a Post Type / ...
8
votes
2answers
10k views

WordPress 3.5: Setting custom “full URL path to files” in the Media Library?

As the recent changes in WordPress 3.5 removed the "full URL path to files" option from media library I am wondering how to set this option to a custom path now? I need to set my "full URL path to ...
8
votes
1answer
2k views

WordPress 3.5: Switch back to Old Media Uploader?

Is there any way to switch back to the old media uploader in WordPress 3.5? The new one is very slow for me, as I have thousands and thousands of images across my site, and I have a few plugins that ...
7
votes
2answers
2k views

Remove “Insert from URL” link in Media upload - WP 3.5

How do I remove the Insert from URL link in the new Wordpress 3.5 Add Media popup page? In earlier versions of Wordpress, this worked fine: // removes URL tab in image upload for post function ...
7
votes
2answers
6k views

Display Media Uploader in Own Plugin on Wordpress 3.5

I have little problem with Media Uploader in new WordPress 3.5. I created own plugin which is upload the picture. I'm using this code JS: <script type="text/javascript"> var file_frame; ...
7
votes
5answers
704 views

Use a separate custom table (not posts) to handle file upload data

The Problem: Website that has over 100 photos per post. Could possibly swell posts-table beyond 100K entries within a few years. The Dilemma: Would much rather stick to default WP UI for handling ...
6
votes
5answers
3k views

Wordpress 3.5 Media Manager - add a button

In my plugin, I would like to add two buttons to Media Manager (to the left of "Insert Into Post" in "media-toolbar-primary" section), and connect a jQuery action to it. First one - The "Select All" ...
6
votes
1answer
361 views

How to make “Upload files”selected by default in Insert Media?

I am frustrated having to click on the "Upload Files" constantly instead of the first choice being Upload Files in posts editor....How can i make “Upload files” selected by default instead of "Media ...
6
votes
1answer
1k views

What plugin can I use to create a list / slideshow of featured images?

I'm looking for a plugin that will allow the user to upload files, maybe 4-10 that can be used on the homepage as part of a slideshow. I can code the slideshow part myself, if necessary, but the thing ...
6
votes
1answer
1k views

Set media upload attachment link to none and hide it in WP v3.5

In the Media upload popup page, how do I set the attachment link to none and hide it in Wordpress version 3.5? The following filter worked fine in earlier versions of WP: function ...
6
votes
1answer
589 views

what happens to existing media files when I switch to year/month directory structure format?

A site has thousands of images in the uploads folder. ISP has threatened to shut it down because it is about to exceed server limits for the max number of files in one directory. I looked at the ...
6
votes
2answers
200 views

How do I use the WP image functions in a page template?

Wordpress has tons of mature code for image editing on the admin side, but I would like to provide a form inside of a custom page template for my visitors to drag and drop, crop and save a thumbnail ...
6
votes
3answers
891 views

Replace audio/video enclosure with player?

Current state: I'm parsing XML feeds into the front end and/or the back end (Admin UI), but not into the DB. Inside those feeds i place mp3- and video content, currently only as plain text (no link, ...
5
votes
3answers
998 views

Media Upload Folder - how to manage

Situation : When uploading an image via the media uploader, WP automatically makes at least 3 additional sizes, that comes to 4 images including the original one. Most of the time, the images will be ...
5
votes
4answers
9k views

How to increase the file size limit for media uploads?

How can I change the Maximum upload file size? I would like to be able to upload 10Mb at a time.
5
votes
4answers
2k views

How can you change the 'Insert into Post' title in the media button?

Actualy the question says it all. I integrated a media upload box to my admin page and a button with the text 'Insert into post' makes no sense. I rather like to change it to something like 'Use this ...
5
votes
3answers
4k views

How to use taxonomies on attachments with the new Media Library?

WordPress 3.5 changed the media management and now the Media Library edit screen uses the default post type UI. Taxonomies are very useful for WP installs with different users and attachments, giving ...
5
votes
4answers
2k views

How to hide media uploads by other users in the Media menu?

Simply put - how might I completely hide media files uploaded by any other users other then themselves? Id like to disable access to these links & files since they are a way for non-admin users to ...
5
votes
2answers
814 views

Adding a custom image upload size and making it selected by default?

How can I add a custom image upload size with a width of 550px and make it selected by default in the Add Media page? Currently, there are 4 sizes available: Thumbnail, Medium, Large and Full Size. ...
5
votes
1answer
2k views

Using one media library for a multisite network with Wordpress 3.5 media library

I'm currently looking to modify Wordpress so that it always uses the primary site for images. I am achieving this using: function use_main_blog_library() { echo "<script>alert('is ...
5
votes
1answer
443 views

Decrease file size upload in Media

By default, I have a 2m limit of uploads. I want to decrease this number. I found out that this code: function custom_file_max_upload_size( $file ) { $size = $file['size']; if ( $size > ...
5
votes
1answer
364 views

Which filters or actions to use after a media upload and delete?

When a media (image) is uploaded and the subsequent images are created (all the different sizes), I would like to perform a few actions. It is simple and I basically need only the new attachment ID, ...
5
votes
2answers
966 views

Wordpress Media Manager 3.5 - default link to

Media Manager once again. This time I'm looking for a simple hack/hook/filter to change default "Attachment Display Settings" from media manager. The option is "Link To" that is default set to "Media ...
5
votes
2answers
2k views

Expanding new Media Uploader in WordPress 3.5

In current version of WordPress it is quite easy to expand the attachments fields using attachment_fields_to_edit filter, but in latest WordPress 3.5 RC2 it's not working. We can expand it using ...
5
votes
1answer
2k views

Put the media uploader in a metabox

I find it very unnecessary to have an "add image" button that brings me to yet another screen that will let me upload content to my post. Ideally I would like to have a meta box with the option to ...
5
votes
1answer
388 views

Image upload callback in new 3.5 media

I am using new 3.5 media uploader in my theme frontend (base on this example). It is very simple when you want to do something with images after the 'Select' button is pressed: ...
5
votes
2answers
946 views

Any plugin out there that uses WP's internal image uploader?

I'm trying to use the media uploader thing from WP (the form from the pop-up with crunching and all that), and can't figure out how. Is there any plugin out there that uses it? It would be easier to ...
5
votes
1answer
2k views

Display attachments by ID in a wp.media frame

I'm trying to use the new wp.media uploader frame for an app I'm building. I've read up a lot on other questions, blog posts, etc etc. The code I pasted below is working already quite fine and even ...
5
votes
1answer
817 views

What's the easiest way to close comments on media/attachments?

I consistently get spam attempts on various and sundry media attachments on my primary WP blog. By default, media has open comments (for instance, ...
5
votes
2answers
4k views

Possible to “Attach” images to multiple posts without inserting or uploading twice?

How can I attach images to a post which have already been attached to other posts without having to upload them twice? I don't want to insert the images into the post, I simply want to attach the ...
5
votes
3answers
595 views

Using Images in Wordpress - Best Practices

I'm not a novice to Wordpress Theme Design & Development. I've actually been doing it for a few years now and in recent years, it has become more than a hobby and is slowing shaping into a career ...
5
votes
5answers
4k views

Upload images to remote server

I am using Wordpress media uploader to upload images and I was wondering if there is a way to make it upload to my remote server instead of my local server? Example: My wordpress blog is hosted on ...
4
votes
3answers
5k views

Linking a PDF as a downloadable document

How do I add a link to a PDF in the content, so that it downloads rather than opens in the browser windows? (I've uploaded the PDF to the media library and can insert the link but can't find an ...
4
votes
1answer
2k views

How to call WP3.5 Media Library manager?

In the past Media Library window could be called like this: tb_show("Upload image", "media-upload.php?type=image&TB_iframe=1&width=640&height=520"); This still works in WP3.5. But I'm ...
4
votes
2answers
543 views

Removing default image size list in Media Box

I trying to remove unused image size (Thumbnail, Medium, Large) in MediaBox Any function can i use in functions.php ? or some trick ? PS : I know i can use jQuery trick but any better function to ...
4
votes
2answers
150 views

Get all posts (of any post type) an attachment is used in

It's not easy to count the amount of posts an image is attached to - WordPress simply doesn't keep track of that. It just keeps track of the post an attachment was originally uploaded to (not ...