Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [media-library]

Media Library is a WordPress panel that display all files you've uploaded. There you can add new files, attach files to posts and pages etc.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
23 views

Multiple domains using same WordPress, set specific uploads folder

For a project at my office I have 3 websites ending in ".nl", ".de" and ".com". They all end in the same folder but don't all have the same images and uploads. My folder ...
user avatar
  • 109
1 vote
1 answer
16 views

Use custom image size in admin panel

I have add some image size like: add_image_size( 'custom-small', 600, 600 ); add_image_size( 'custom-medium', 1280, 1280 ); add_image_size( 'custom-large', 2560, 2560 ); and I have removed all the ...
user avatar
  • 13
0 votes
1 answer
50 views

Update media library image shown in "attachment details" when using wp_insert_attachment to add item to the media library

I'm using the function wp_insert_attachment() to run on a form submission from GravityForms, take a file uploaded in the form, and add it to the WordPress Media Library. Code in functions.php below, ...
user avatar
  • 146
0 votes
0 answers
26 views

Remove duplicate media entries from mysql database

I am wondering if you can help. I have a wordpress site with 90000 media entries, but only 1000 images. I do not want to remove the images from the media gallery just the entries in the database that ...
user avatar
0 votes
0 answers
11 views

Larger preview thumbnails in Media Library

Is there a way to force the Media Library to use bigger preview thumbnails in grid and list views?
user avatar
0 votes
0 answers
17 views

Filter Media by attached page or blog post in Library

I am trying to create a filter using restrict_manage_posts that will filter all media according the page or post type that have been attached to. Actually i need to create a filter that refers to the ...
user avatar
0 votes
0 answers
16 views

Offload Media Library to other domain on a different server

How is it possible to change the media storage of Wordpress to a subdomain on a different server. The main domain example.com running on a server pointing to IP 192.168.0.1 and I've created a ...
user avatar
0 votes
1 answer
42 views

Add media button always inserts media on the next wp_editor instance when created dynamically

This is a really weird issue. I am trying to store data from a form in a plugin settings page and allow users to add html code with wp_editor. The users can dynamically add as many fields as they want ...
user avatar
  • 105
3 votes
0 answers
54 views

Using the <MediaUpload /> component outside the editor. select('core') is null

I am using the WordPress components in the admin panel of my plugin and trying to make an image upload button. The button works fine and allows me to select an image, but when I select an image, I get ...
user avatar
0 votes
0 answers
11 views

Custom image sizes showing in Classic Editor only when upladed directly to post

I can't get custom image sizes to appear in Image details size selector unless the image is uploaded directly in the post. If you choose an image from the Media library only default image sizes are ...
user avatar
  • 1
1 vote
1 answer
27 views

Fallback media image for featured image not working in admin column

I want to display a fallback image if a custom post type does not have a featured image set and displayed in a custom admin table column. However all that is being output is the image url and not the ...
user avatar
  • 125
0 votes
0 answers
19 views

get all images from the wordpress media library with link to the post they are associated with

I'm trying to get all the images from the wordpress media library with link to the post they are associated with. I'm using this code, I get all the images, but the link is the link to the URL of the ...
user avatar
1 vote
1 answer
111 views

How to upload images in a specific folder using API

I have installed wordpress plugins Real Media library, Real Physical Media, and Media file renamed. Using this I am able to physically move images and organize images in the upload folder as per ...
user avatar
0 votes
0 answers
12 views

How can i sorting and display image order by siz in media library?

How can i sorting and display image order by size in media library? Sorting is important for me? Any one can help me please?
user avatar
1 vote
1 answer
19 views

Media library style not loading correctly when selecting a page featured image?

I'm trying to set a featured image to some pages, so when I press select featured images the media library upload UI not loading correctly its own stylesheet ( get images and search are working ...
user avatar
  • 21
0 votes
0 answers
10 views

How to create wordpress media library UI on plugin page

I am trying to add this media library user interface just like it's used in WordPress. I have attached the image below. I know about the WP_LIST_TABLE class for creating tables, now what class do I ...
user avatar
  • 561
1 vote
0 answers
88 views

Insert woocommerce products programmatically with featured image and gallery

I'm inserting WooCommerce products programmatically to the database, but I'm having trouble inserting and linking first image as featured image and multiple images for gallery assigned respectively to ...
user avatar
  • 11
0 votes
0 answers
9 views

Media Library / Backend: How can I search for text in the ALT Text field?

By default, a search in the media library of WordPress 5.9 finds only media items which contain the search string in the following fields: Title Caption Description In other words, it does NOT ...
user avatar
0 votes
0 answers
30 views

Wordpress Media Import, images not in Media Library

I have performed two imports using the WP Importer plugin, one of a custom post type and the 2nd of the Media Library. Both imports appear to work, on fact a second attempt to import the Media Library ...
user avatar
2 votes
1 answer
39 views

Media library storing files in uploads not folders within in uploads

I am working on a site rebuild, I need to preserve about 100 blog posts that include images. I was having issues exporting the images and I decided to just download them via FTP. However, I found a ...
user avatar
0 votes
0 answers
55 views

Filter images from media library by guid meta field

I am using the ajax_query_attachments_args filter attempting to remove certain images from the wordpress media library. They are all in a separate folder within the uploads directory called "...
user avatar
1 vote
0 answers
55 views

Media Library Grid View Custom Filter

I'm trying to use the Backbone, customizing the Author Filter in media library grid view. I found lots of information on the Internet, and create filter on the toolbar. But there is one error I can't ...
user avatar
1 vote
0 answers
63 views

AJAX - save an $_FILES picture in media library

From an array like this Array ( [file] => Array ( [name] => 100522738.jpg [type] => image/jpeg [tmp_name] => /Applications/MAMP/tmp/php/phpv9nkXY [error] => 0 [size] => 41784 ) ) ...
user avatar
  • 13
1 vote
0 answers
20 views

How to enable sorting in custom media uploader in plugin

In my plugin I need a media uploader exactly like the one you see when you select a post's featured image. I managed to do almost everything with this code: media_uploader = window.wp.media({ ...
user avatar
  • 21
0 votes
0 answers
77 views

How to upload large media file in chunks, without any plugin?

How to upload large media file in chunks, without any plugin ? I have done something like this, it's uploading the file, but after uploading the media file, the uploaded file is not visible in media ...
user avatar
  • 13
0 votes
1 answer
13 views

Launch Media Library for specific MU site

I have a form on my front end that I'd like to call a media library modal, but I want the library accessed to be a specific MU subsite. I trued to switch_to_blog around the wp_enqueue_media function, ...
user avatar
  • 913
0 votes
0 answers
20 views

Possible to show in media library if images are being used as featured images?

Is it possible to make an admin column in the media library that will indicate whether or not an image is used somewhere as a 'featured image'?
user avatar
0 votes
0 answers
21 views

How to locate the js code and php code for certain function?

For example, I want to debug the code for uploading an image when composing a post. I click the "Add Media" button, right-click on the "Media Library" tab, click the "Inspect&...
user avatar
  • 103
0 votes
0 answers
9 views

How to validate image with specific height and width selection in media selector

Is it possible to validate images with specific heights and widths in WP Media Selector, when user select image? <div class="form-field pwb_brand_cont"> <label for="...
user avatar
  • 153
0 votes
0 answers
11 views

Bulk Image Resize for Media Library, but for ENLARGING instead of Shrinking

I have hundreds of images in my Media Library. I know there are many plugins that can do Bulk Resize, but all those I've seen only allow you to set a Max Size (you can't enlarge small images, only ...
user avatar
  • 101
0 votes
0 answers
139 views

Using WP-CLI "wp media import" to sync files to the media library

I'm rebuilding an old website which is 3 years old. The new website has a different sitemap and media files. For this, I have created a fresh WordPress install. However, I'd like to maintain the old ...
user avatar
  • 1,913
0 votes
1 answer
78 views

How to limit the number of images displayed in the media window?

I have a lot of images in my website, so when I open wp-admin/upload.php the server slow down. Would be possible to display only 50 images per time? I saw there is this similar question, but it works ...
user avatar
  • 127
0 votes
0 answers
408 views

“The REST API did not process the context query parameter correctly.” Custom theme conflicting with Media Library

I'm having the “The REST API did not process the context query parameter correctly.” error message on a custom theme, the media library isn't working correctly. I do have shortcodes on my function.php ...
user avatar
  • 1
0 votes
1 answer
32 views

Migrating media files (documents only) to a fresh install and maintaining the same directory structure

I've rebuilt an old website from scratch on a fresh install. On the old (production) website there are over 1000 PDFs and Word docs. These have been uploaded over a 3 year period via /wp-content/...
user avatar
  • 1,913
0 votes
1 answer
49 views

Cannot create new posts or upload images using media manager

My WordPress website was recently moved from one a shared hosting provider to a VPS setup at Digital Ocean. I provisioned the server myself and have WordPress running on a LAMP stack with Linux Ubuntu ...
user avatar
0 votes
0 answers
51 views

Hide media library images from other roles uploaded by admin

Can this function (https://www.role-editor.com/forums/topic/hide-specific-images-or-images-by-specific-user-role-or-specific-user-id/) be updated to hide images from other users (but not admin) in the ...
user avatar
  • 976
0 votes
1 answer
105 views

wp.media gallery collection sometimes undefined

I have a function that includes an external image-source into the media-library (wp-admin/upload.php), by making an ajax-call to said image-source, formatting the response appropriately and inserting ...
user avatar
  • 1
0 votes
1 answer
44 views

Adding Alt Tag and Dimensions columns to Media Library

I use the code below to show the alt tag in the Media Library column, but I also use an extra column/code to show the image dimensions. The only problem now, is that the dimensions are also shown in ...
user avatar
  • 1
0 votes
0 answers
29 views

Publish / unpublish media items in the media library

I'm wondering if / how I might publish and unpublish specific media library items without deleting them, using plugins and/or theme code. My use case is that I am planning a site where pages will ...
user avatar
  • 146
1 vote
2 answers
232 views

Restrict WordPress Media Library for a specific user role (users can only see/select own media)

I have 4 roles in my platform : administrator, author, editor, external I need to restrict WordPress media library access to the user’s own uploads only for one users role (external) on my platform. ...
user avatar
  • 264
0 votes
0 answers
92 views

How to add custom media library mime icons?

Can't seem to get wp_mime_type_icon filter to work so I can use custom image for icons in the Media Library for documents. @birgire answered this post with the following code, but it does not seem to ...
user avatar
0 votes
1 answer
90 views

Possible to hook into Media Library preview File column and use a custom image?

The project I'm working on, I couldn't find an easy way to have WordPress create the thumbnails sizes I needed without tons of waste, nor to simultaneously generate WebP versions, so I disabled the ...
user avatar
1 vote
2 answers
42 views

Automatically assign video 'poster' value to 'filename' for archive listing

One of my sites is used as a personal diary with >5000 videos uploaded within the media library. Each post uses the following shortcode, disabling pre-load and assigning a manual poster. This ...
user avatar
0 votes
0 answers
61 views

Allow wp media library to check already selected images displayed in div

I would like to replicate the media selector library in my plugin: (I have a button, I click on this, the media library display, I select images and add in a div below) When I select one image or ...
user avatar
0 votes
0 answers
22 views

How can I no-index specific PDF files in my Avada Wordpress media library so that they don't appear in search results?

I'm trying to no-index specific PDF files in our Avada Wordpress media library so that they don't appear in search results. We have yoast SEO plugins but I contacted their customer service and yoast ...
user avatar
0 votes
0 answers
21 views

Efficient way to move media folder to another folder

The media library is currently organized by months and years .../uploads/2021/09/. I'd like to go without the months and year and use the url .../uploads/ for future uploads. For consistency, I'd like ...
user avatar
0 votes
1 answer
66 views

How does wordpress handle media files?

I couldn't figure out how wordpress handles media library. I copied the media files from one vm to another using gcloud compute scp... The files are successfully copied to the wp-content/uploads/ ...
user avatar
0 votes
0 answers
40 views

Wordpress append -1 to the image name

For e.g. I deleted apple.jpg. Image is deleted permanently. After a while, I upload apple.jpg. Wordpress still append -1 to the image name apple-1.jpg. However, apple.jpg is no where to be found. I ...
user avatar
-1 votes
1 answer
123 views

Blurry Images Wordpress 5.8.1

I've tried to Use .png instead of .jpg Disable wordpress default compression add_filter('jpeg_quality', function($arg){return 100;}); Switch themes to test Disable plugins Regenerate thumbnails ...
user avatar
1 vote
0 answers
38 views

Wordpress auto generates small medium and large of an image on upload, how can we guess their links?

WordPress out of the box has an integrated image sizes system, which creates files ( thumbnail, S, M, L) but in the media library, it only shows one original file size link. Let's say, I upload a file ...
user avatar

1
2 3 4 5
19