0
votes
0answers
5 views

Display all images except those uploaded via OptionTree

I'm using the following to display all images in media library however, I'd like to exclude images uploaded via OptionTree as these are either banners or logos. $args = array( 'post_type' ...
0
votes
1answer
83 views

Is it important to get the media files attached?

A silly question may be, but I's thinking about the SEO matter, and thinking that, is there anything related to the SEO regarding the Media file attachment? There are 567 images in my Media Library, ...
0
votes
0answers
37 views

Attachment Metadata not updated while uploading audio files

Suddenly, I am having some issues when uploading audio type of file in wordpress. previously, when I uploaded .mp3 files, the attachment metadata of the files were updated accordingly, for instance; ...
0
votes
0answers
20 views

Is there a way to add Reattach and Unattach links in image gallery?

For some reason the Reattach and Unattach links in Media library is gone. Is there a way to add these from functions.php?
4
votes
1answer
71 views

complex restriction of items in media library

I have a need to limit items in the media library for users without a specific capability. There are a lot of examples out there for how to limit them to only items that a given user has uploaded, ...
0
votes
1answer
193 views

Show selected images on top in Media Manager

I've searched numerous StackOverflow and Wordpress Awnsers questions, but I couldn't find any solution that matches my situation or even remotely points me in the right direction. I have a custom ...
4
votes
2answers
381 views

Delete Associated Media Upon Page Deletion

Note Use at your own risk, it is buggy and I have run across a couple instances where it would delete ALL attachments. Unsure why. Is it possible to delete media associated with a page when that ...
0
votes
1answer
114 views

Get images attached to a specific page

Is there a way to fetch the URLs and captions of all images attached to page x?
1
vote
2answers
3k views

Password protect some uploaded files, so only logged-in users can view them

I would like to protect some uploaded files, so that they are not publicly accessible (they are not accessible without a login). I'm uploading some PDF files, and I'd like to mark some of them as ...
0
votes
1answer
53 views

How to retrieve images contained in a post

I'm working with the new media manager, and have a little issue to retrieve the attachment of the post. I'm developing a plugin which needs to retrieve all attachments of specific posts. I first ...
1
vote
1answer
258 views

Show how many images are attached to a post/page on compose page

On the front-end, I'm using a query to show all attachments attached to the current post. However, on the compose page, there's no way for a user to see how many images are attached without opening up ...
2
votes
1answer
866 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', ...
2
votes
2answers
2k views

How can I hide media library images from general users?

As an admin I really like the features and functionality of the WordPress 3.5 media manager. With a multi-user site however all users can see all images in the media library - whether uploaded by ...
3
votes
1answer
227 views

Show Post ID in “Find Posts or Pages” box in Media Library?

In the Media Library, when I go in to attach a media item to a post, I know I can use "Attach" to pull up the "Find Posts or Pages" pop up. This brings the following list of post title, date and ...
1
vote
1answer
141 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
1answer
78 views

Where does the gallery shortcode gets its attachments from?

I know that media are an attachment post type that are children to a post, but how are galleries stored in WordPress?
0
votes
4answers
2k views

Get the attachment URL on single.php

i've been trying to get the attachment URL on single.php, so far this code gets the DIRECT LINK to the image; <?php if ( $attachments = get_children( array( 'post_type' => 'attachment', ...
2
votes
6answers
16k 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
114 views

Add attachment for all images in post

I want to move someone else's WordPress blog to a new server. I only have access to the exported XML file of the blog. When importing the XML with the Wordpress Importer plugin, everything went fine ...
0
votes
1answer
90 views

How to save media-form on custom tab

On my custom tab, I copied media-form from media_upload_gallery_form, only changed form id and action-url to reflect my tab's name. The form displayed as expected, but after click "Save All Changes", ...
0
votes
1answer
383 views

How to fetch only media that was already attached to a post/page?

Situation: my client has this simple gallery built with WP_Query showing the latest media added to the site: $cola = new WP_Query( array( 'post_type' => 'attachment', 'post_status' ...
0
votes
1answer
465 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 ...
1
vote
1answer
690 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
2k views

Gel all image from certain post type

I've found similar questions here, however I can't modify the answers to get images only from a certain post type - as the post type in those examples are "attachment" and not the name of a custom ...
5
votes
1answer
431 views

Edit image / Delete image link

There is a function in Wordpress that allows to display a "edit post" link if the user has sufficient rights. <?php edit_post_link( __( 'Edit' ), '<small class="edit-link">', ...
1
vote
1answer
1k 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 ...
0
votes
1answer
232 views

All images on one line for each post

Having trouble getting around the issue where my client wants all of the images for each post to be on one line. This can be done in the editor, but they are not very tech savvy -- just wants to be ...
1
vote
3answers
1k views

Control attachments menu order with jQuery Sortable

I've managed create a metabox that lets me upload and then fetch the images and then also been able to add jquery ui sortable to be able to sort the images, however I've no idea how to add actual ...
0
votes
1answer
515 views

Media library only show 2 items per page?

For some reason WordPress media manager is only showing 2 images per page? This is happening on 2 separate sites now and I can't get rid of it. Is there a way to manipulate items per page for the ...
0
votes
1answer
1k views

Proper use of wp_get_attachment_image?

I have two images attached to a page. One is being used as the featured image, and I want the other to automatically be displayed at the designated spot in the template (within the loop) at full ...
0
votes
2answers
3k views

Get an image from the media library. Struggling with the code?

Struggling with this code, the conditions work, the only way I can get the wp_get_attachment_url is to loop through it but then this outputs as many images from the media library and I only want one? ...
1
vote
1answer
580 views

How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?

I am attempting to resolve a problem I continue to have with the media library. Essentially, what I am looking to do is "automatically" assign media which is uploaded from a custom post type "edit ...