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.

354 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
19 votes
0 answers
2k views

Extend Media Library

The Media Library in WordPress has "Insert from URL" link to the left. It accepts image URLs. It's not said anywhere but if you paste YouTube URL or <iframe> code then it will insert ...
user avatar
  • 191
12 votes
0 answers
292 views

Custom collection in media manager?

I'm working on a plugin that extends the media manager, load JSON based input data to render an own collection of images and may upload them to my wordpress media library. So far I got my own tab, ...
user avatar
  • 121
5 votes
0 answers
224 views

Customize WordPress Media Manager - Media Window

Im trying to customize the wordpress media manager "add media" window to get it as simple as possible to use. So i want to disable/ hide the following fields/ functions because i dont need some or ...
user avatar
  • 376
4 votes
0 answers
2k views

Images dont show in grid view, but do in list view

In media library, images show in list view, but not in grid view. This becomes an issue because adding a featured image is done by grid view only. I had to edit the DB to make all jpg files lower ...
user avatar
  • 368
4 votes
2 answers
3k views

Multisite: use media from one site vs. copying the same media to all language sites?

This is a business site with product images. I have a multisite installation with 3 languages in 3 directories which will later be mapped to completely separate domains by the host when it's finished....
user avatar
4 votes
2 answers
1k views

Is it possible to share WordPress media files among different domains?

I have multiple Wordpress instances that live on separate domains (not a multisite installation). Since they provide the same content in different languages I'd like to share the images among these ...
user avatar
  • 267
3 votes
0 answers
124 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
3 votes
0 answers
46 views

What is "open()" in MediaUpload?

Googling (or searching here) on "open" is hard :) The readme for MediaUpload gives this example: <MediaUpload onSelect={ ( media ) => console.log( 'selected ' + ...
user avatar
3 votes
0 answers
768 views

Restrict file types in the uploader of a wp.media frame

When creating a wp.media frame in JS, is it possible to specify allowed file types for the uploads tab? wp.media({ title: 'Pick a PDF', button: { text: 'Use this file...' }, ...
user avatar
  • 131
3 votes
1 answer
776 views

Create custom tab in WordPress 5 media upload

Can someone help me create custom tab in WordPress media library. With WordPress version 4 i used to media_upload_tabs function to build that nice work. But now, in WordPress version 5 the function is ...
user avatar
3 votes
0 answers
89 views

How can I use the TinyMCE editor for the description field on a Media item?

When I view an image in my Media Library, the Description field textarea has a toolbar, but it's only for creating HTML tags. How can I get the TinyMCE wysywig editor to be used instead? I've found ...
user avatar
3 votes
1 answer
746 views

Image upload via FTP to wordpress media library

Is there any permanant way to upload images via FTP to WordPress media library other than the available plugins which don't really work well most of the time? I would really appreciate if anyone ...
user avatar
  • 41
3 votes
0 answers
45 views

Script won't execute in the media manager

I'm trying to execute a jquery script on the click of a button in a custom tab of the media manager, but it does not seem to work. I have been told this might be due to the button not being loaded ...
user avatar
  • 131
3 votes
1 answer
291 views

Image editing: "Edit Original" and "Replace" buttons missing on old posts

I have a site I've recently migrated to a new server. Everything is mostly looking okay, except on existing posts: when we go back to edit a post, and edit media attachments within it, the "Edit ...
user avatar
3 votes
0 answers
2k views

Custom media picker in meta box: how to select available image sizes?

I have a custom meta box where a user can select an image and save it using wordpresses media picker, set up with some JavaScript. That works fine, but I'd like the option to select which version of ...
user avatar
  • 423
3 votes
0 answers
2k views

Changing image URLs in media library

On a default wordpress install, the media library is located at: /wp-admin/upload.php. I am trying to update the image URL to point to my CDN, not my local server. This filter add_filter('...
user avatar
3 votes
1 answer
91 views

Where is the source of the media items filter

I couldn't find the source in the php files. What is generating the select drop-down for the attachment filters in the media library?
user avatar
2 votes
1 answer
99 views

Getting media library popup in custom plugin admin page

I’m creating plugin and I need to upload images. And I’m wondering if I can somehow trigger same popup as “add featured image” triggers. Is that possible? If not, how can I make an alternative? Thanks ...
user avatar
  • 121
2 votes
0 answers
89 views

How to host different file formats/types for a media attachment without creating multiple attachments?

For a better browser compatibility we often have to maintain multiple format of a media. For example: Image - JPG & WebP Image animated - GIF & WebP Image transparent - PNG & WebP Video - ...
user avatar
  • 7,625
2 votes
0 answers
198 views

Make Categories a Dropdown Menu in Media Library

I would like the categories menu to appear as a drop-down in both the list mode and grid mode view of the Wordpress media library. As of now, it only appears as a drop-down in list mode. List Mode - ...
user avatar
2 votes
1 answer
105 views

How can I make the Uploaded field editable for Media Library?

The 'uploaded' date field for Media Library entries is read only. Is there a way to make it editable from the Attachment Details window in upload.php? I've tried the following code as a plug-in. It ...
user avatar
  • 753
2 votes
0 answers
487 views

Media library not loading after switching the main site of multisite

I switched the subsite and main site of a multisite. Now, the images are not loading in the media library and posts of the main site. However other subsites are working fine. The images of the new ...
user avatar
  • 23
2 votes
0 answers
147 views

Perform a custom (bulk) action in media view

I wish to figure out how to add a custom action button in the media grid view ( upload.php screen) and how to perform a custom (bulk) action to the selected attachments, as shown in the screenshot ...
user avatar
  • 89
2 votes
0 answers
22 views

Replicate featured image functionality

Is there a wordpress way of creating a custom field just like the Featured Image field? The field should be implemented in my custom meta box on the post edit page at the back-end.
user avatar
2 votes
0 answers
63 views

Can I store WordPress media in different sub-folders?

How can I have my media files saved in different sub-folders of my choosing in WordPress? It just only use one folder for all media which make it hard to manage them. Just to be clear, I'd rather ...
user avatar
  • 359
2 votes
0 answers
255 views

Media gallery thumbnails 1px

So I exported/imported images from one site to another (don't even want to get into the headache that has been causing!!) The latest issue is that it appears that all of my images have copied over ...
user avatar
2 votes
1 answer
370 views

Different upload path per file type

I want to have two different paths for different files. For example, I have all .zip and image files all in the same locations. What I am wanting to the have images in one path (eg. wp-content/...
user avatar
2 votes
0 answers
142 views

Edit single attachment on click (WP-admin)

I've created a custom media manager for a CPT I've created. I have everything functioning properly except an edit function. I want to have an edit button for each attachment that gets added to the ...
user avatar
2 votes
0 answers
395 views

Refreshing collections in the admin media manager

I know this question is very similar to this previously asked question; however, I was wondering if there was a more up-to-date/official way to refresh content programmatically in the WordPress admin ...
user avatar
2 votes
0 answers
850 views

Display only my own files/images in media library

I just want to let user see only their own files in media library. I have 2 questions: it works great on list of media library. add_action('pre_get_posts','users_own_attachments'); function ...
user avatar
  • 683
2 votes
1 answer
978 views

Adding wp_enqueue_media(); causes problem

I want to add the media uploader in the theme options page. If I add following code in the options page, the media uploader works fine there, but it creates problem in the standard posts featured ...
user avatar
  • 61
2 votes
1 answer
245 views

Hide upload image fields for the different media upload popups

I am trying to change a few of the options in the Set Featured Image popup in the Wordpress admin. I can't seem to find anything that determines if the popup window is a Featured Image or an Add Media ...
user avatar
  • 427
2 votes
1 answer
273 views

Display latest 12 images from media library

I was looking for almost a week for such solution - without success. What I want to achieve is have a kind of 'photos cloud' on my wordpress homepage. What I need to do is to display latest 12 photos ...
user avatar
2 votes
1 answer
251 views

"Insert Into Post" For Custom Button

I'm in the process of trying to build a improved media library for our contributors. I have set up a custom taxonomy category for media, and set up a tab in the Add Media popup box for browsing ...
user avatar
2 votes
0 answers
533 views

Pages redirected to attachment post

THE SETUP I'm using WordPress 3.4.2 with Magic Fields 2 plugin. Using MagicFields2, I've added a custom field to the builtin 'page' post type. This field is called 'section_header' (which is ...
user avatar
  • 131
1 vote
0 answers
36 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
1 vote
0 answers
309 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
1 vote
0 answers
106 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
71 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
  • 23
1 vote
0 answers
25 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
1 vote
2 answers
325 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
  • 284
1 vote
2 answers
43 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
1 vote
0 answers
39 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 vote
1 answer
56 views

In Wordress one author can not see the other's author uploaded images through media library

My problem is simple to explain, when author 'A' uploads an image, author 'B' can not see them in the media library and via verca. Any idea what could cause this problem? As an administrator i can see ...
user avatar
1 vote
0 answers
57 views

Display attachments by the ID of the post being edited in the wp.media frame (frontend)

There is a button in the frontend on the post page to upload images. How do I display attachments that are attached to this post in the wp.media frame? How to intercept wp.media's AJAX request for ...
user avatar
1 vote
0 answers
357 views

Update image via WP REST API

So I wonder if its possible to update images in the media library via the REST AP? Ive seen a github issue back in 2016 where its mentioned this its not supported in the REST API. Is this still the ...
user avatar
  • 111
1 vote
0 answers
20 views

how to remove thumbnail and LiteSpeed Optimization column in media library list-view?

I've searched on the internet, and found out this code from this link function remove_upload_columns($defaults) { unset($defaults['comments']); unset($defaults['author']); return $defaults; } ...
user avatar
  • 111
1 vote
0 answers
31 views

Uppload image from another source wp.media

I am writing an extension that will load images from third party sources and embed that image in WP media library. I cannot figure out how to manage wp.media to load such images. How it will work. ...
user avatar
  • 113
1 vote
0 answers
47 views

wordpress media library new uploads don't write to database

I recently updated a wordpress multisite to 5.6 and since that update, new uploads to the media library don't add new entries in the mysql database, and consequently don't show up in the media library....
user avatar
  • 11
1 vote
1 answer
35 views

Media Gallery Images - safe to change permalink?

I am new to blogging and learning as I go. I wrote a few posts with lots of images and now that I am learning about SEO, I realize I need to add alt text and have names that are relevant to the image (...
user avatar
  • 11

1
2 3 4 5
8