Questions tagged [media]
An image, audio or a video comprises a media.
1,088 questions
0
votes
0
answers
13
views
Display image sizes in media library and make it sortable
I've used this code https://wordpress.stackexchange.com/a/296517/254438 to add image sizes in media library.
How do I add sorting of image sizes? I know there are plugins but I don't want to use any ...
0
votes
0
answers
12
views
How to Modify Gallery Preview on Edit Screen on the "Visual" Tab in Classic Editior
I am modifying the gallery_shortcode() function from media.php using a plugin.
How do I make my custom gallery structure show up as the preview on the edit page. I want to change how it displays in ...
0
votes
1
answer
9
views
Can you open a media frame to sellect an attachment to associate with another attachment you are editing on an existing media frame?
I want to have a media frame that pops up on click of a button on an existing media frame.
This way I can associate another attachment with that attachment.
This question shows an example of you can ...
1
vote
1
answer
100
views
Automatic image conversion to HEIF breaks Gallery on Safari
Wordpress 6.7 now supports HEIC image formats. Since version 17, Safari (on Mac, at least) automatically converts any uploaded image to HEIF format if the input filetype allows that.
Uploading images ...
0
votes
0
answers
15
views
Media Attachment Pages Redirect to Media Files After Migrating to WordPress Multisite
I've created a WordPress multisite network and successfully imported sites into it. On each site, I need media attachment pages enabled, so each image should have its dedicated attachment page. ...
0
votes
1
answer
24
views
Featured Image add tab
I was wondering if there's a hook/function to add a new tab to the Featured image modal window as shows in the picture below:
I've found this thread How to add new tab to media upload manager with ...
-1
votes
1
answer
16
views
Uploading media from non-local host computer
I am working on a Wordpress site that is locally hosted on another computer. I have admin privileges so I should be able to make the changes I need, but I am having trouble uploading new media. I keep ...
4
votes
1
answer
94
views
Getting fatal error when using manage_media_columns filter of WordPress
When I am using manage_media_columns filter of the WordPress I am getting the fatal error.
This is the code I have added in my functions.php file.
add_filter('manage_media_columns' , 'book_cpt_columns'...
1
vote
3
answers
1k
views
This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading
This image cannot be processed by the web server. Convert it to JPEG
or PNG before uploading.
description: https://ibb.co/r31V1gk
0
votes
1
answer
50
views
Get Specific Files (Only Specific Extension Type All Files in Loop ) from Media
I want to get Specific Extension Files from Media of Current Post Uploads—for Instance, .jpg or .png or .pdf, or MP4. (Get Only 1 Extension All Files From Current Post Uploads)
Specific Extension ...
0
votes
0
answers
53
views
Enable Downloads on WordPress Attachment Page
I'm currently working on a WordPress site and need some help with enabling downloads for video attachments on their respective attachment pages. Since the videos are being handled in bulk, I'm using ...
1
vote
0
answers
48
views
Wordpress is adding "-1" to the filename of media items
On a website I administer, I just noticed that Wordpress is adding "-1" to the filename. Which is expected behavior for a file that has already been uploaded.
But these files have not been ...
0
votes
1
answer
58
views
Cannot add image (png, jpeg, etc.) but can add pdf, 403 forbidden when posting
I just encountered a bug when I am trying to post with images. When I am adding media using "Add Media" button, the image will not add and will have this error:
POST https://philsa.gov.ph/...
0
votes
0
answers
23
views
Images being uploaded via WP Media are not attached even they are used by some CPT posts
I would like to delete thousands of images on my WP websites which are no longer used by some CTP posts which have been removed even from Trash folder.
However, I found out that Images being uploaded ...
0
votes
2
answers
65
views
Wordpress MediaElement audio player won't seek and resets back to the start when files are locally hosted
Edit: If anyone runs across a similar issue; the problem was I had Cloudflare DNS Proxy turned on for my server and that was causing the audio issues. It seems to be a semi-common problem from ...
0
votes
1
answer
46
views
When inserting media file in a post or page, show file name under the thumbnail
When using insert media into a page it shows a grid of pictures. How can I change that to see file names instead (or both)? And would there be a way to have the images sort by file name?
0
votes
0
answers
58
views
How to Upload a media item with alt text and description
I'm trying to upload a media file to the media library with the altText and caption for it using the media endpoint: https://developer.wordpress.org/rest-api/reference/media/#create-a-media-item
...
1
vote
0
answers
21
views
How to add a post page from a button without reloading
I am a novice in developpement and I am trying to create a page. When I click on the button Gutemberg, it will generate a post page with a text and an image. The problem is that the page is created ...
0
votes
1
answer
127
views
'Add Media' to post - filter images
Can anyone help me with this? ...
I am trying to locate and understand the javascript and/or php/ajax code that filters the thumbnails that show in the interface when a user clicks "Add media&...
1
vote
3
answers
220
views
Front end form with images and media_handle_upload logic?
I'm building a front-end form with image submissions.
The form creates then a new post:
...process post...
$application_id = wp_insert_post($application);
I then use media_handle_upload to upload ...
0
votes
0
answers
14
views
How to make the search form in "Add media" search custom attachment fields?
I've added custom fields to image attachments on my site, something like this:
function mysite_attachment_field_to_edit( $form_fields, $post ){
$form_fields['my_ref'] = array(
'value' =>...
1
vote
0
answers
23
views
Updating a remote media library plugin, wich breaks on php 8.1 update [closed]
We use the (now abandonware) plugin Remote media libary, with the Flickr add-on.
It allows the user to see the wordpress photos and albums in the media library.
https://wordpress.org/plugins/remote-...
0
votes
1
answer
129
views
Can not access .txt file which I uploaded through media
I can not access my uploaded .txt in Wordpress, it gives a 403 access denied error. I can access .png files however, why not .txt files?
I uploaded my file here:
And got the URL here (I click copy, ...
0
votes
0
answers
37
views
I have uploaded thousands of files in the uploads folder via FTP and I want to register them into the database without any plugin
I have uploaded thousands of files in the uploads folder via FTP and I want to register them into the database without any plugin because plugin takes so much time. Is there any way to register them ...
1
vote
0
answers
22
views
How to revert the media structure from /uploads/year/month to the /uploads directory in wordpress?
I tried to use wp-cli using regex like this:
wp search-replace 'uploads/[0-9]+/[0-9]+/' 'uploads/' --all-tables --regex
but in this case there is a problem with possibly repeated file names and ...
1
vote
1
answer
459
views
Convert base64 string to WordPress attachment uploads multiple images instead of a single one
I'm trying to convert a base64 string to an image file and upload it into WordPress media library.
It seems like the code is working, but, for some reason, every time I call this function it uploads ...
0
votes
1
answer
89
views
stop resize button for wordpress media
The images in my WooCommerce product gallery do not need to be resized I only need the original image to display. Is there a way to add a toggle button to wordpress media to tell it to generate other ...
0
votes
1
answer
25
views
How to prevent wordpress from redirecting media attachment page to media page?
For some reason googlebot tried to index my media attachment pages and got redirected to media pages.
This seems to be a default wordpress behavior.
To recreate it, upload an image called test.jpg to ...
0
votes
1
answer
42
views
Media Library Issues
(All plugins disabled) I have some strange issues with the media library. It's an old site that I have been managing for the last 2 years. The site has dated media folders on disk going back to /2010/...
1
vote
1
answer
103
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
1
answer
48
views
audio tags no longer working
On my website, I had a plugin, that displayed a media tag like [audio src=path/file.mp3]. It returned this tag in the HTML retruned from the shortcode function.
function init() {
add_shortcode('...
1
vote
1
answer
29
views
wp-content/uploads/year/month returns 404
I have a litespeed hosting
I have disabled all plugins and all wordpress related htaccess rewrites.
If I go to https://digitalzoomstudio.net/wp-content/uploads/2023/ - then I can see the directory ...
1
vote
0
answers
181
views
Undefined array key "width" in wp-admin/includes/image.php error when publishing post or page
When publishing a post or page that includes trusted SVG files in the content, WordPress spits out the errors Undefined array key "width" in wp-admin/includes/image.php and Undefined array ...
3
votes
1
answer
810
views
How do I display a PDF thumbnail as a link to the PDF without uploading the image
When I found a couple of years ago that WordPress will create thumbnails of uploaded PDFs, I was so happy, thinking I wouldn't have to make and upload separate PDF cover images to have a thumbnail ...
0
votes
0
answers
100
views
Permission to edit media files (photo captions, alt tags)
What permission is required for a user to be able to edit all media files in Wordpress?
I'm trying to edit the captions and alt tags of some media files in Wordpress. I can see the media file in the &...
0
votes
3
answers
502
views
How can I get the Media Library backend to show larger thumbnails?
I have a pretty simple need. On the admin screens, my media gallery is reducing my picture thumbnails to about 145x145 so they'll fit in 6 columns across the screen. The only way I can get a good look ...
0
votes
0
answers
33
views
Multimedia upload error in my wordpress job board plugin
I have the below code in my plugin. Admin is meant to be able to insert funding_amount, funding_deadline, and funding_multimedia_field from the dashboard if the resource category chosen is funding. ...
0
votes
1
answer
755
views
Uploading images via ACF update_field function
I am trying to update image fields within a group in ACF via the update_field function
I am successfully adding the images to the media gallery but I am having trouble getting them added to each ACF ...
1
vote
1
answer
117
views
How can I get all attachments by a user on a WP multisite network?
I'm creating a front-end based project where users can make posts and add images to them. It's a network of sites that users have access to.
For a better user experience, I want users to be able to ...
0
votes
1
answer
71
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 ...
1
vote
0
answers
57
views
Problem with "is_user_logged_in()" and woocommerce (Code for custom media upload for each author.)
I'm sorry for my english...
I am using the following code to create separate media directories for each author..
( Thanks to https://wordpress.stackexchange.com/a/400352/220907 )
function ...
0
votes
1
answer
715
views
How allow only the uploading user access to media
I have an application that requires that only the user + admin can access files uploaded by that user?
EG a user uploads an image to media. Only that user should have access to it
Thanks for any tips
...
0
votes
0
answers
27
views
Unable to access media library, but getting an error as forbidden You don't have permission to access this resource. I have administrative rights
Unable to access media library, but getting an error as forbidden You don't have permission to access this resource. I have administrative rights
2
votes
1
answer
160
views
wp.media multiple selection limit
When I use wp.media dialog , is there a way to limit how many files can be selected when multiple option is used?
wp.media({
library:{
type: "audio"
},
...
0
votes
1
answer
203
views
How to solve too many files in uploads folder(s)?
my wordpress has this setting for upload - .../uploads/{year}/{month}
However I noticed that some folders (like .../uploads/2023/06) have 30+ thousands files.
So I want to relocate them to new ...
0
votes
0
answers
37
views
Optimize blog that serves hundred of images and videos
We have a website that contains 20,000+ media. It serves images and videos per post(500 post as of now). Opening posts takes a very long time to open because it contains images(500+) and videos(50+).
...
2
votes
1
answer
57
views
Add to Media Inserter Categories
As of Wordpress 6.2, Openverse was integrated into wordpress and it is available under the Media Tab of the Inserter.
I want to develop a plugin that integrates another stock image service into the ...
0
votes
1
answer
711
views
Uploading media to wordpress API with C# HttpClient
I was trying to save some media but I can't get it to work. I don't know if its the authorization is the wrong format, or if its the content is just put in wrong. If someone knows how to please help ...
0
votes
0
answers
133
views
Add custom css class to wp-list-table row for Media Screen
How to add class to the row of WP List Table in Media List page like the following.
Add custom css class to wp-list-table row for custom post type
Thanks
1
vote
1
answer
218
views
wp media regenerate says "no regeneration needed" whe that's no the case
I'm trying to generate thumbnails for a PDF attachment. Right now in the uploads/ folder there is only the PDF file, no image thumbnails related to it.
But when I run the regeneration with :
wp media ...