Questions tagged [media]
An image, audio or a video comprises a media.
1,033
questions
0
votes
0
answers
19
views
Hook on file upload
I need a hook or some way to detect when the window to select the file to upload is opened. I'm talking about the window that opens the browser to select the local files to upload.
Context:
On ...
0
votes
0
answers
20
views
How to get a list of all attachements urls for every post of a wordpress installation?
I'd like to retrieve a list of all attachment URLs for all posts of a website.
This would bring something like
http://example.com/mypost/attachment-1/
http://example.com/mypost/attachment-2/
http://...
0
votes
0
answers
43
views
Delete Post but retain image of post [WP REST API]
Currently, when I delete a post in my wordpress website, the image is deleted automatically.
Which is fine for most cases, however, there are certain posts where I don't want to delete the image from ...
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 ...
1
vote
1
answer
53
views
Thumbnails generated from PDF in the "Media" section - how to show them in theme template?
I have an ACF custom field for "File". It allows users to upload PDF files of some reports.
In the Media section in WP Admin, I can see that the PDF we upload auto-generates the thumbnails.
...
0
votes
0
answers
14
views
Access generated thumbnails
Is it possible to allow my editors to access the generated media thumbnails within the media library?
So for example, when a user selects an image, they should be able to also select the thumbnail ...
0
votes
1
answer
36
views
Double Slash After Media Path (uploads//)
After performing an SEO Audit on my client’s website I found out that several images have a double slash in their URLs. This seems to be happening just to media files, and the double slash is ...
0
votes
0
answers
14
views
wp.media libary pdf type
What would be library type to show only pdf documents in uploader?
wp.media({
library: {
type: 'pdf'
},
});
I tried 'pdf' and 'application/pdf' but its not working, it shows all media.
0
votes
1
answer
14
views
WordPress Media Library Folders + Custom Linux Server Hosting
I'm coming to you because I have a big problem with my hosting and the functioning of the FileBird - WordPress Media Library Folders plugin. I created my hosting on a NAS, on a virtual machine with ...
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 ...
0
votes
2
answers
13
views
Media changes not updating posts
What happens:
Write a post
Create a gallery
Upload a random picture
Set caption to "test"
Publish Post
Go to Media -> Select the picture from before
Set caption to "changed" ...
-1
votes
1
answer
52
views
wp_temp_dir does not change the /tmp temporary default directory
I have a problem changing the temporary folder. I have have define the new temporary folder using
define( 'WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/' );
before the line
/* That's all, stop ...
0
votes
0
answers
119
views
Setting wp_temp_dir and permissions not working for "Missing A Temporary Folder" error
I have a problem uploading files to my main webpress site (e.g. www.main.com) and all the other pages that live in it (e.g. www.main.com/anotherpage). I know there is a method to set a temp folder ...
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 ...
0
votes
0
answers
13
views
Site/Post preview is not working on all social media
I am facing a site preview-related issue.
Whenever I paste my site or post a link on social media platform then they must be shown that particular link preview, but except the Facebook, none of the ...
0
votes
1
answer
11
views
Media permalink to go directly to uploaded PDF, instead of a media page with a link
When someone visits our permalink, we need it to go directly to the media PDF, rather than showing a page with the preview which is clickable. Is this possible?
1
vote
1
answer
26
views
How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product
How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product.
Because I want to make a photo album blog, the images within each post ...
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 ...
0
votes
0
answers
29
views
Migrating Wordpress Uploads To S3 Object Storage
I currently migrate my wordpress media to s3 bucket.
Does any one know of a way to redirect all the existing image urls to the s3 bucket instead if we manually copy the files over? Could this be done ...
0
votes
0
answers
146
views
how can I change all wordpress media file url to custom cdn url?
any function can apply change all image URLs to CDN instead of modifying media.php in wp-includes folder
?
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 ...
0
votes
1
answer
22
views
Returning data instead of echoing/printing
New to WordPress (and PHP) and am trying to get this PHP snippet to work with the Code Snippets plugin so I can display all media attachments within my post. It is working, in that it shows the ...
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/...
0
votes
0
answers
17
views
Import media (.xml) does not attribute featured images to posts
I am exporting all content from one wordpress site and importing to a clean install.
The featured image of each post is not loading after being imported even though the media has been imported.
The ...
1
vote
1
answer
62
views
File Type Is Not Permitted - Cronjob
I am currently developing a cron job that downloads a xml file from an external source and stores it within wordpress media.
For debugging proposals, I have installed the plugin Advanced Cron Manager, ...
1
vote
1
answer
121
views
Display "large" image size and show caption in attachment page
On the attachment page for an image, I'd like to display the image in its "large" size. The current behavior is showing the "medium" size image.
I'm using a theme I created from ...
0
votes
0
answers
10
views
User uploads image as "Featured Image" but WordPress resizes it?
I have a user with permissions of Author uploading an 800x238 image to WordPress as a Featured Image.
When it's uploading, I can see that it uploads correctly:
https://ygoprodeck.com/wp-content/...
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 ...
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. ...
0
votes
0
answers
20
views
New Question: Need frontend access to media library edit function
Good morning,
Our site allows logged-in users to upload images to the media library on the front-end. However, when they click on the edit image link, they are thrown out of the media library and onto ...
0
votes
0
answers
34
views
Profile image does not upload
when i logged in "Font-End" as a user "Employer" and try to upload my profile image, it does uploaded but when i click update i got this alert error " No editor could be ...
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 ...
0
votes
0
answers
25
views
How to add image from theme files to media library after theme activation?
Based on this post - Programmatically adding images to media library I'm trying to add image from my theme to media library, once, after theme activation. My code:
add_action( 'after_setup_theme', '...
0
votes
0
answers
26
views
Use media files from a different server just for one custom type
I have Big PDFs on my site so I move it to differ server.
is there any way I can show it n my media gallery popup when I click add feature image or upload images without importing them to my current ...
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 ...
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 ...
0
votes
1
answer
79
views
Do custom post type (CPT) attachments/media store the parent post ID?
Do custom post type attachments store the parent post ID, and if so, how do I retrieve it.
I need to prepend the ID of a CPT post to the uploaded media name, eg 123-my-file-name.pdf
I do have this ...
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/ ...
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 ...
-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 ...
0
votes
1
answer
54
views
Create multiple folders in upload media folder
Is there a way to upload images to multiple folders in the media library without using a plugin. This is to create file paths to enhance SEO for an online store. I would like to have the URL show ...
0
votes
0
answers
15
views
How to restrict media upload resize by filename suffix?
I'm trying to resize image dimensions when I uploaded images to the Media Library so I don't have extraneous sizes I don't need clogging up the uploads folder. I'm defining specific sizes with ...
0
votes
0
answers
9
views
In wp_postmeta.meta column I see media links with a param at the end like 'WalkingOnTheSun.mp3?_=6', What is this _=6?
I am writing a script to clean up a database for a client, and I am remapping higher quality media files throughout.
In the wp_postmeta.meta column I am seeing numeric params at the end of some of the ...
0
votes
0
answers
18
views
Processing resized images upon upload
WordPress creates resized copies of images that are uploaded to the media library. When I upload an image, I want to do some processing on these resized images. Currently, I'm using a add_attachment ...
0
votes
1
answer
248
views
Create a permalink to a pdf?
I have a website where I want the permalink to my resume to be www.example.com/resume, so that whenever I send someone that link, it goes to the most recent version of my resume. But I don't want my ...
0
votes
1
answer
62
views
Use rich text editor in 'Edit Media', for attachment media description
I have the following in my functions.php:
add_filter( 'wp_editor_settings', function( $settings ){
if( get_post_type() == 'attachment'){
$settings = [
'wpautop' => true,
'...
0
votes
1
answer
141
views
Make inline uploader (plupload) on options page upload to a specific folder
I’ve set up an options page for my CPT that contains the drag'n'drop upload area (just like Media → Add New). Basicly, I’ve copied all the relevant stuff from wp-admin/media-new.php and it works like ...
0
votes
0
answers
38
views
Blog suddenly can't display .jpg
I’ve been managing https://Barrett.Lang-Learn.org for a fellow who self-describes as technology-illiterate. He recently told me his header image has disappeared.
I logged in and went to the media ...
0
votes
0
answers
22
views
Allow a specific user role I have created to only upload one image to his media library
Hello guys I was following this article but the code doesn't seem to do anything. The last one by Maruti Mohanty is doing something , it doesn't allow any files to upload with an error. Set a maximum ...
0
votes
1
answer
218
views
wp.media issue with selected image
First of all, I know there are many questions related to this question. But what the problem is that they are all related somehow to jquery.
But my question implements the vanilla javascript.
...