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.
977
questions
0
votes
0
answers
8
views
Different upload file size limits based on file type
I would like to put a different limitation on uploading content in the media library ( depending on file size and file type)
For example :
Upload mp4 (allow maximum upload file size 64mo)
Upload pdf (...
0
votes
0
answers
10
views
How to change media folder from created time of the post to publish date?
Now, all the structure of the media folder is under /wp-content/uploads/ and years-months combination from the created date of the post.
Is it possible that his path will automatically change to /wp-...
0
votes
0
answers
17
views
I'm planning to offload my WordPress Media Library to a CDN? Would you recommend it, and why (or why not)?
I'm currently setting up a brand new hosting server for a client of mine that owns a news site. One idea that was suggested by the team was to offload the Media Library files entirely onto a CDN. ...
0
votes
2
answers
47
views
Removing filename searches when searching attachments
My website's db is quite big. I have some 350,000 images in the media library (as well as some 350,000 posts). My wp_postmeta table has 4,580,552 rows.
As a result, some queries are insanely slow and ...
0
votes
0
answers
21
views
"Virtual" image in WP Media Library (external URL)
We are using a CDN in an external system (DAM) to store all of our images, and I am trying to find a way to integrate this to WordPress.
The functionality I would like to achieve is:
Use the WP Media ...
0
votes
1
answer
39
views
Does Wordpress Super User or Administrators can create and edit post and media on behalf of a user
For my project I need to administrate user post and media without access to it personal account.
So I must be able to create and edit a post (by is user name) before or after it has been created on ...
0
votes
0
answers
13
views
Why wordpress doesn't allow to add author filter to media library page in grid mode
It appears that Wordpress doesn't allow to apply new author filter to upload page (upload.php) in "grid" mode.
If it's right, why?
If not, does it exist a specific hook/function to allow ...
0
votes
1
answer
24
views
Unable to upload media files: Maximum upload file size: 0 B [closed]
All of sudden I am seeing the above. php.ini already have the following lines:
post_max_size = 1024M
upload_max_filesize = 1024M
1
vote
1
answer
39
views
How do you detect when an image has been deleted from WordPress media library?
I want to detect when the user click "Delete permanently" in media library so that I can use the post ID of said image to remove the image from my plugin. I have the below code, but it's not ...
0
votes
0
answers
33
views
How do I modify the TinyMCE editor Add Media button to insert a thumbnail preview of PDFs in addition to a text link?
We're still using TinyMCE as our post editor.
When Editors use the 'Add Media' button to select a PDF from the Media Library, they choose the preview image from the Attachment Display Settings at ...
0
votes
0
answers
51
views
Adding multiple MIME types of the same extension to WordPress?
I am trying to enable DWG MIME types for WordPress file upload, and tried applying this filter. However, because it's the same array, it won't work and will only apply the final one below. Wondering ...
0
votes
0
answers
31
views
Media Library empty or only 1 item when invoked from custom post type set featured image button
Custom post type 'offer' is defined in a 'mu-plugin' using ACF syntax including featured image support. Theme functions also explicitly declare featured image support for this custom post type.
When ...
0
votes
1
answer
35
views
Detach Wordpress Media Files In Bulk
Just switched WP themes and I have about 1300 media files attached to what Wordpress is calling a 'Private Post'.
These Private Posts are actually photo portfolios from the previous theme. 200 ...
0
votes
1
answer
34
views
Wordpress Media Uploader not displaying image that has just been uploaded
I am trying to implement a custom WP Media uploader within a plugin. I want multiple images to be uploaded also.
I have the following javascript to open the media uploader. The modal opens fine and ...
0
votes
1
answer
20
views
Is there a way to override only a portion of the function print_media_templates defined in wp-includes\media-template.php?
I'd just like to -safely- change the visual presentation on the Attachments pop-up window, ie. move some of the main DIVs around. But it seems like the only hook is to the entire function which is ...
0
votes
1
answer
22
views
Media manager asks for file title when upload
When I upload a new file I have this error message : Content, title, and excerpt are empty.
I found the error messahe in wordpress_data/wp-content/languages/en_GB.po line 6809 (but it's a post related ...
0
votes
0
answers
33
views
how to upload pdf or word file to media library with code
I'm adding a new feature to the cart page, that needs to upload files (word or pdf) to the media library.
I am using this code
ob_start(); ?>
<form method="post" enctype="...
0
votes
0
answers
12
views
Using "require_once" in my plugin breaks Media Library access from Dashboard
I am developing a plugin in Windows 10 UwAmp wordpress environment, with "Twenty Twenty One" theme. PHP 8.0.28, mysql 5.7.11, WP 6.2.2.
At present my plugin file is as follows:
<?php
...
0
votes
0
answers
9
views
How to add more images horizontally to existing gallery using elemontor
I deleted all my unattached images from media as I had so many copies not being used and now I'm missing all my images in my gallery.
The grid is already there so it should only be to upload add the ...
0
votes
0
answers
13
views
possible to use media library with independent set of files in plugin?
I'm looking to have a page located in the Wordpress admin backend powered by a custom plugin have access to upload and manage previously uploaded images, essentially using the media library. But I am ...
0
votes
1
answer
24
views
Add URL in image upload error message
I'm wanting to add a URL link into the image upload error message, but it's only printing the string, not adding the hyperlink. I'm using the code below
function my_max_image_size( $file ) {
$...
0
votes
0
answers
21
views
image block select modal > custom tab on the media modal with filtered media and allow select media
I want to do a plugin to mark some media files as Favorite and then the favorite media marked allow be displayed on the Select image modal that is showed when a user try to add or replace an image via ...
0
votes
0
answers
103
views
How to make Media Library files private?
I noticed that I can still browse my media library "attachment page" without being logged in.
In other words, it seems like all you need to do is find one attachment page, and then you can ...
1
vote
0
answers
27
views
Is there any halfway decent documentation on the wp.media JS class?
Sorry for the somewhat rambly question, but has anyone ever seen any good piece of documentation, or maybe even a tutorial on the wp.media JS class?
All that i could find documentation-wise is this ...
0
votes
0
answers
15
views
in classic editor, is there a way to add media lib files to the content search when creating a link?
In TinyMCE Editor, one can highlight some text, hit Ctrl-K and search for a list of matching posts to link to. Is there a way to add Media Lib Attachments into that list of possibilities?
3
votes
1
answer
77
views
How can I add custom sizes for PDF thumbnails generation?
I define custom image sizes in my theme like this :
add_action( 'after_setup_theme', 'mwm_custom_image_sizes' );
function mwm_custom_image_sizes() {
add_theme_support( 'post-thumbnails' );
...
0
votes
0
answers
94
views
Editing alt text in media library
I added a column to the media library to display the alt text using this information, however I'd also like to edit the alt-text entry of each image without having to go into and edit each individual ...
0
votes
0
answers
41
views
Load images from CDN and custom features to "Add Media" dialogue
I have a multisite setup with 10 different websites, and I want to integrate the platform (WordPress, custom built theme from scratch) to an Digital Asset Management System.
What I would like to ...
0
votes
1
answer
38
views
Files showing in link but cannot be found in the upload directory
https://fleurdelys.nl/wp-content/uploads/2018/04/legle-sous-le-soleil-5-100x100.jpg
I have this file that really shows up in the browser. If i check the upload directory it can noyt befound in the ...
0
votes
1
answer
214
views
What is the proper use of guid for images in wp_posts?
I understand that guid is a unique reference for a post, whether that post is a post or an attachment.
When it's a post, I think guid is self-evident. But what is the correct formulation/destination ...
0
votes
1
answer
57
views
Assign multiple categories to Media Library upload
I want to be able to upload files and either immediately or after upload assign multiple categories to them. I have 3 different kinds of PDF document: Treasurer report, minutes, and newsletter. What I ...
0
votes
2
answers
42
views
Media library upload hook
I would like to create a function that fires when a file is uploaded to media library to automatically assign multiple categories. So I created this code as proof of concept, but it is not assigning a ...
0
votes
0
answers
166
views
Block non logged in users from accessing the media library
I have a custom login page for a site I'm working on that isn't related to the backend login. The purpose of this is so users that aren't logged in cannot see the site. When the site loads it looks ...
1
vote
0
answers
42
views
upload image to wordpress media library failed for custom post type
image upload failed. I tried to upload gym logo as thumbnail image for gym post type. All the form elements are working. But image upload is not working. images are not appearing in WordPress media ...
0
votes
1
answer
91
views
wp cli media commands not working
I am trying to bulk update media file captions through WP CLI so i can attribute image creators.
My command is as follows:
wp media list --date="2022-02-24" --format=ids | xargs -n 1 wp ...
0
votes
0
answers
113
views
Looking for a way to insert PDF image preview in TinyMCE
We're still using TinyMCE as our post editor.
When Editors use the 'Add Media' button to select a PDF from the Media Library, they choose the thumbnail or medium size image from the Attachment Display ...
0
votes
0
answers
25
views
Remove Edit Attachment Button in Wordpress Mediathek -> see Screenshot
i would like to remove the button via css or hook, thanks for your help!!
0
votes
0
answers
27
views
How to filter the URL of thumbnail size in the Media Grid and admin pages
I need to filter the URL of the thumbnails in the Media Grid (or any admin pages) by getting the original image URL and adding some URL parameters to generate the thumbnail on the cloud using the AWS ...
0
votes
0
answers
19
views
Is there a way to upscale a media library original image to the nearest whole pixel in Wordpress?
I noticed today while manually regenerating thumbnails for images in the media library that at least one would not generate thumbnails for those sizes that had the same width as the image.
In fact, ...
0
votes
0
answers
20
views
Using autocomplete with post_tag taxonomy on attachments
How do I use autocomplete on the post_tag taxonomy that I added to my attachments?
Following the suggestion here, I added the post_tag taxonomy to my attachments:
function dod_add_tags_to_attachments()...
0
votes
1
answer
226
views
Image in binary in the data to WordPress media library
A specific API, returns an image in binary in the data.
If I need to save it to the server, I can easily do it by following the code.
$response = curl_exec($curl); // This is the API response
...
0
votes
0
answers
16
views
Images have dissapeared from media library and site
I manage a WordPress website for a client of mine. About a month ago she emailed me that some images are missing on the site.
I have been investigating what could be the problem for a while now, and I ...
0
votes
1
answer
940
views
Many images in wp-content/uploads folder that are not in Media Library
I think my database must be out of sync, or something. I checked the wp-content/uploads folder in my Bluehost File Manager and I have many more folders and files than I see in the Media Libary.
I also ...
0
votes
0
answers
144
views
How can I change the page title of PDFs opened from a WordPress link which use the browser's viewer?
When you open a Media page and click the link to open an attached PDF, it uses the browser's own code to generate the HTML wrapper. And the HTML title is extracted from the PDF.
We have many documents ...
0
votes
0
answers
172
views
How to bulk edit taxonomies for attachments
I am looking for a way to bulk edit taxonomies for the attachment post type (basically, for images).
I needed to categorize a large Media Library, therefore I added a custom taxonomy by using "...
0
votes
0
answers
240
views
Upload to a specific media folder created by FileBird Lite
I have an import that runs in the background of my server through cron. I have a plugin called FileBird Lite (https://ninjateam.org/wordpress-media-library-folders/) that helps create folders and such ...
0
votes
1
answer
13
views
Wordpress Multisite Medial Library not working for .online domain
I have a wordpress multisite domain setup (subdirectory setup) and all the domains have been working fine (all end in .com). I've recently added a domain ending in .online. When I visit the media page ...
0
votes
1
answer
78
views
How do I restore attachment from files in wp-upload
I used the wordpress import tool to import a file and downloaded the attachments included. After a successful importation, I discovered that my media library only contains 3 file. After hours of ...
1
vote
2
answers
622
views
Wordpress can't get image url but both the attachment and the actual file are there
The following applies to all attchment images on my site:
There is a PNG image attachment, its ID is 519271.
wp_get_attachment_image(519271, 'thumbnail', false, array( 'id' => 'esjb-preview-image' )...
0
votes
0
answers
160
views
How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
I'm on a shared hosting plan. Getting this error log entry when the user tries to update any field on a Media Attachment.
[13-Oct-2022 20:10:05 UTC] PHP Fatal error: Maximum execution time of 60 ...