An image, audio or a video comprises a media.

learn more… | top users | synonyms

1
vote
2answers
783 views

Using Default WordPress Custom Header Image Crop Feature in a Post Type / MetaBox

I am not sure how many of you have experimented with the new custom header image functionality of wordpress 3.0 but its actually very cool (enabled by adding the function to your functions.php file). ...
1
vote
2answers
3k views

How to single click to download image in single post

i have attacment.php like this. <?php if ( $attachments = get_children( array( 'post_type' => 'attachment', 'post_mime_type'=>'image', 'numberposts' => 1, 'post_status' => ...
1
vote
2answers
215 views

How do I get allowed Media Library upload file extension list?

WordPress has list of allowed Media Library upload extensions in wp-includes/functions.php but is there any way to return them to theme's files as an array?
1
vote
1answer
563 views

How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page

This post shows how to remove unwanted fields from the media uploader. It works great, but I want to limit it to a custom-post-type and I can't seem to figure out how to do it. I've tried the ...
1
vote
1answer
296 views

Float images in content

This is not a programming question. I have the problem to update the content in my WordPress blog. I'm very aware this problem can be solved by html modification. But my client doesn't know about ...
1
vote
1answer
743 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
2answers
5k views

How do I force Wordpress to show most recent version of images in the media library?

My workflow is sometimes the following: Delete many images from the media library at once (named for example, 01.jpg, 02.jpg, 03.jpg...). Re-upload a series of images with the same file names ...
1
vote
1answer
64 views

Show attached media image if no thumbnail image detected

I use the if ( has_post_thumbnail() ){} to check if the post have thumbnail image, but this echo get_attached_media('image', $post->ID); displays the word Array I need to show the ...
1
vote
1answer
2k views

“Add Media” button in custom plugin

I'm writing a custom plugin and i would like to add the "Add Media" button. I just need to upload media, not to retrieve any content/data from the uploaded file. How can I add this button? Thanks
1
vote
1answer
196 views

Creating a Lightweight Media Tags Plugin with a Custom Taxonomy

We’ve been using Media Tags ( http://wordpress.org/plugins/media-tags/ ) for a while, particularly for the dashboard media management features rather than any of its front end display features. It ...
1
vote
1answer
569 views

3.5 media manager add CSS / JS to new 'tab' iframe content

Whilst (patiently) waiting for proper documentation and/or a few tutorials on the new media uploader I'm still using the media_upload_tabsfilter to add a tab to the uploader. Here's my (working) code: ...
1
vote
1answer
345 views

Add custom image sizes to media uploader

I want to add custom image sizes to the media uploader: In order to do this, I use the following code (comments are there for convenience): // this function adds the custom image sizes to the ...
1
vote
1answer
205 views

Check if post has gallery images/media

Is there a Wordpress conditional that I can use to check for gallery images/media in a post? I do not want to check if the [gallery] shortcode exist in a post. Attached is a screenshot of what I ...
1
vote
1answer
138 views

How to manipulate “add media” pop-up

Is there any way to add your own button next to "insert into post" button on the "add media" pop-up? I would like the button to add my own shortcode tags around the inserted image. The desired ...
1
vote
1answer
661 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
1answer
801 views

Image still attached to post even after removing it as featured image

I'm sorry if this is too noob of a question, but when I upload an image and set it as the featured image then later remove it (as featured image), the media list still shows it's "Attached to" the ...
1
vote
1answer
545 views

Add media column to edit post screen

I am trying to add a column in the edit post screen that shows any attached media. I found this code to do it with tags, but don't know how to change it to do Media attachments instead. //add media ...
1
vote
2answers
34 views

How to get an image url from media library

I have got an attachment id, but I need an url. How can I get an url from the attachment object? // When an image is selected, run a callback. frame.on( 'select', function() { // Grab the ...
1
vote
1answer
150 views

How to get media objects

I am busy with a loop to return all media in the medialibrary in objects. I figured out how to get the images ( with wp_get_attachment_image('$mediaID') where the $mediaID is the id of the image ) ...
1
vote
1answer
77 views

Password protect media attachment - share across guests

I'd like to show certain content to people with a password, specifically links to media files like this: <?php if($currentuserid == foobar): ?> <a ...
1
vote
2answers
71 views

How to side load an image from a service

I am currently working on a WordPress plugin that creates dummy content. I'd like to also have the plugin create random images using a service like http://lorempixel.com. The problem however is that ...
1
vote
1answer
229 views

Replacing all attachment links in post with media file link

I'm working on a Wordpress site, where all images inside posts are linking to the corresponding attachment pages. I want to use a lightbox but obviously this would require changing all the links back ...
1
vote
1answer
169 views

Modify the array of selected images in media modal

I'm creating a plugin which checks for duplicate media items on upload. If a file is uploaded, and it already exists in the media library, I'm presenting the user with the option to delete the ...
1
vote
1answer
209 views

Media upload not working on theme option in WordPress 3.8.1

I have this jQuery code in my plugin to display a media box preferably to upload an image or to pick an image from the media gallery: (function($){ jQuery(document).ready(function() { ...
1
vote
1answer
143 views

Change media attachment author via mysql query

How does one bulk change the media attachment author via an sql query? I have hundreds of media attachments that need to be moved to another author so the original author can be deleted; but that ...
1
vote
1answer
56 views

Large image size stuck on old value, even for new images

I changed the 'Large' image size in Settings > Media > Image Sizes from the default to max-width 586px. That was wrong, so I changed it back to max-width 1024px. However, the smaller size seems to ...
1
vote
1answer
421 views

Hide Default Video Shortcode Controls on PageLoad

In wordpress 3.6+ when we use default video shortcode [video], controls of video are always visible on pageload. How can we hide these controls on page load and show only when we hover over the video ...
1
vote
1answer
129 views

What filter should I use to insert a button inside on Media>Add New

I am adding a new way to upload a media file to WordPress. So I am looking for a way to add a link or a button to the Upload New Media page. What is the recommended filter? Or is there another better ...
1
vote
1answer
599 views

Use the WP media uploader dialog for uploading a form attachment (non-admin). Offering progress and drag and drop feedback

I am building a simple contact form (non-admin) that has an attachment field. Of course I can just handle the upload via WP's wp_handle_upload function. However, I would like to give my visitors a ...
1
vote
1answer
373 views

Set a custom URL for image in the Media Library?

I'm having some real frustration with the Media Library, as a WP beginner. What I'm expecting is that I can upload an image, and then reuse that image where I want within the site, using a standard ...
1
vote
1answer
90 views

Can I force all uploaded images to be reduced in quality?

There is a blog where high quality images (300KB at 800x550) are being uploaded and embedded at Full Size. Wordpress will just use the exact uploaded picture when you embed at Full Size. This makes ...
1
vote
1answer
362 views

Upload media files to Amazon S3

I have a site that is running on AppFog.com, and they don't have persistent file storage for things like images uploaded through the wordpress media uploader. The theme I am making for the site ...
1
vote
1answer
1k views

Custom bulk action for media gallery items

I'm trying to add custom "Bulk Actions" to WP 3.5 new media gallery items. I started from this excellent tutorial which does exactly what I need, but with regular posts; so i tried to adapt it to work ...
1
vote
1answer
538 views

Image size filtering in Media uploader according to custom post type

I have three different custom post types which require an image upload in the admin post edit page. Each type has its own image size setting. Let's say: 'news' type => picture size required: ...
1
vote
2answers
2k views

Errors when uploading images in WP 3.5

I'm trying to upload images in WP 3.5 to set featured images for posts. Unfortunately I get the following error message: An error occurred in the upload. Please try again later. The installed ...
1
vote
1answer
134 views

Restore Image Title Text

In WordPress 3.5, when images are inserted into posts, the title attribute is not included in the image tag. The Lightbox plugin I am using requires the title tag to be present on images; besides, I ...
1
vote
1answer
763 views

How to Add Custom CSS to the Media Thickbox?

I've added a couple of custom fields to the Edit Media screen, but when these are displayed in the WP Media Thickbox (when adding images from the Edit Post screen, for example), the styling is gone. ...
1
vote
1answer
132 views

Large Media Library

I'm looking to organize a large WordPress Movies/Actors site, with thousands of posters, screenshots, etc... I currently have the images in a directory structure like ...
1
vote
1answer
159 views

Post Specific Uploader

I have played around with filters for uploading files. The closest I have gotten is to have the files uploaded to the directory, but after the file uploads, I get a series of errors: Undefined index: ...
1
vote
2answers
422 views

Rotating image does not work for custom image sizes

When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem ...
1
vote
1answer
106 views

media 'path' issue / concern when bringing files live

I'm currently developing a site we have installed on a sub-domain. 'beta.mysite.com' We will eventually, be moving site to it's root domain. 'www.mysite.com' Problem? any post type attachment / the ...
1
vote
1answer
312 views

image in my post disappeared after I upload website to remote server

Before I upload my website to server, I created post with images which are uploaded to media, their url are, for example: http://localhost:40952/wp-content/uploads/2011/09/study_in-En.gif After I ...
1
vote
1answer
251 views

Plugin or method to delete uploads not in media library?

Over time working on a local and development server I've accumulated some junk in my wp-content/uploads folder which are not in the database. The folder and database entry are fairly large and so I ...
1
vote
2answers
406 views

Out of Memory when Uploading an Image

Sometimes when I upload a picture (either with flash or browser uploader), I get a message like (this was with a 1.46MB jpg): Fatal error: Out of memory (allocated 69206016) (tried to allocate 4000 ...
1
vote
1answer
287 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 ...
1
vote
3answers
2k views

How do I change the upload file size limit in single-site wordpress install?

In the multi-site wordpress install, you get a very nice "upload settings" in the network admin settings. (see attached image). I am trying to change these settings without using php.ini for a ...
1
vote
2answers
216 views

Wordpress bug with capabilities?

EDIT: aha! It appears to be the "Role Scoper" plugin causing this problem. Deactivating it restored the functionality. Consider this question null. I've enabled the capability of uploading files for ...
1
vote
2answers
236 views

Pull images from the gallery

I am building a template where wordpress is being used primarily as an image CMS, I am pulling the first image from the content section of each post. <img src="<?php echo grab_image() ?>" ...
1
vote
1answer
555 views

window.send_to_editor throws unterminated string literal error when adding image with multi line description

I am using media-upload.php?type=image&tab=library script to add an image to a post with a description that contains html. This php script uses the javascript function window.send_to_editor to ...
1
vote
1answer
403 views

Audio Player for MP3 Files for Wordpress

I have a wordpress account. I am just using the free wordpress account which does not allow me to install any plugins. I have an mp3 file and I want it to appear as an audio player. There are many ...