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
0answers
14 views

Is there a reason why import/export Image Alt text, Caption and Description is not natively support by Wordpress?

I'm relatively new to Wordpress development, there are many things I don't understand. It took me some time to have a basic grasp of how media library works so you can tell I am a slow learner. ...
0
votes
1answer
25 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
0answers
20 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
0answers
26 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 ...
1
vote
0answers
23 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 ...
0
votes
0answers
14 views

"Organize my uploads into month- and year-based folder" Option Not Visible in Multisite

For whatever reason, I can't see the "Organize my uploads into month- and year-based folder" checkbox in Settings > Media. I'm using WordPress multisite with sub-directories, and it's a ...
1
vote
1answer
15 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 ...
0
votes
2answers
33 views

How to add if statement on WordPress shortcode output

I'm making a shortcode function that collects data from WordPress media library function byn_recent_resources_shortcode($atts, $content = null) { global $post; extract(shortcode_atts(array( ...
0
votes
0answers
14 views

How to saving a file to Media Libary by code

I'm building a plugin that works only in admin. I've a page where the user choose some parameters and the script get data from posts and posts meta then it generate a pdf file and then I want to save ...
0
votes
0answers
17 views

Admin Custom Plugin List Files in admin Table

I'm building a plugin that works only in admin. I've a page where I need a list of files, users can only download or delete the file. I've this questions: I don't know what is better to list the ...
0
votes
0answers
35 views

WordPress media library attachment-filter: Different set of mime types are appearing in List and Grid view modes

I have an array of mime_types like the following: $mime_map = array( /** Data types */ array( 'name' => 'Comma separated (csv)', 'mime' => 'text/csv', 'ext' =>...
0
votes
0answers
26 views

Is it possible to limit number of files a non-admin user can upload via the WordPress media library?

How can I limit a non-admin user to only be able to upload 6 images at a time in the WordPress library? I'm trying to limit the number of files a user can upload using the WordPress media library via ...
1
vote
1answer
22 views

How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?

I am using the TinyMCE advanced editor for my Wordpress site. I want the users in the frontend to be able to upload images using the Wordpress media gallery, and for this purpose I would like to remap ...
0
votes
0answers
15 views

How to allow Authors to access media library in Wordpress?

I have a multi-user Wordpress site and several users are assigned the Author role (I don't want those users to give the Editor roles for some obvious reasons). The Authors can upload pictures but they ...
0
votes
1answer
20 views

Auto delete content in specific folder inside media library

I am looking for solution to auto delete images (jpg, gif, png -content in general) inside a specific folder (folderx) INSIDE the uploads/months folders (customization intended for future folderx --...
0
votes
1answer
29 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
0answers
16 views

connecting and synchronizing the WordPress media library with Google Drive

Is there a way can connecting and synchronizing the WordPress media library with Google Drive?
0
votes
1answer
31 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. ...
0
votes
0answers
29 views

Using the admin Featured Image's modal in the front end

I am trying to get the new upload frame of the featured image used in the admin side, but the one used in the front is different. I will show you some screenshots: In the admin section when I click ...
0
votes
1answer
29 views

how to get random media id from media gallery

I tried to get random media id from wordpress media gallery using this: $image_ids = get_posts( array( 'post_type' => 'attachment', 'post_mime_type' => '...
0
votes
2answers
126 views

How to upload media to specific year/month folder

This answer describes a hack in which it is possible to upload new media to an "old" folder like 2012/12. That hack no longer seems to work in recent WP versions. Meanwhile, all the plugins ...
0
votes
1answer
22 views

Media Library http to https

My website is currently displaying mixed content because the images from Media Library are in http. I've used a few plugins to update the URL and search and replace all http references to https. I've ...
0
votes
1answer
26 views

How can I delete duplicate `*-1.jpg` images?

I would like to delete all files that end with -1.jpg in media library as they are duplicates. I use sudo rm -r *-1.jpg at the wp-content/uploads folder. They are deleted successfully. However, images ...
1
vote
0answers
11 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 ...
0
votes
0answers
23 views

Add Media Library for Frontend (no Plugin)

I would like to use the entire wordpress media library for the frontend. I want any user that views my homepage to be able to upload, manage and delete the files in the media library. I will add a ...
0
votes
0answers
40 views

How can i set media attachments to the author of the post or page for already existed posts with attachments

I have been uploading posts for multiple authors in my site and the attachements (photos) are registered all in my account. Is there a way to set the attachements to have the author of the post ? I ...
0
votes
0answers
16 views

How to copy the all Wordpress media items to another custom plugin folder?

I created a custom plugin to compress/zip all media items in a folder for that I create a plugin and inside the plugin, I create a folder. Now on that folder, I want to add/copy my all WordPress ...
0
votes
1answer
24 views

Bulk Edit Media Library alt, caption, image names

I need to bulk edit images names, alt and captions of about 300+ images. My edit is to remove underscores that were auto generated to replace spaces and use them as alt. A CSV will help a lot but I ...
1
vote
1answer
25 views

how to use media library [closed]

hello i want to use wordpress media library . i want to user see the library when click on button i made and choose a picture and i get a link of picture wich user choosed . actualy i want to learn ...
0
votes
0answers
32 views

Custom Widget with Image Uploader

I'm currently trying to make a widget for a theme that includes an image uploader. However, since I have had little to do with custom widgets in wordpress, I thought I'd just look on the internet. ...
0
votes
1answer
23 views

Custom Image Widget

I need to create an image widget which is similar to the wordpress media image widget, defined in the wordpress core in wp-includes/widgets/class-wp-widget-media-image.php. I only need a couple minor ...
0
votes
1answer
20 views

Can't load a script in my plugin page

I'm trying to include two scripts, wp_media and my personal when I stay in my plugin options page, but Wordpress don't include it. Someone help? /** * Activate the plugin. */ function ...
0
votes
1answer
38 views

Multiple images are generated in WP-content in wordpress

when I upload the images in WordPress using the dashboard. upload media. But when I go into the wp-content>>media or using Cpanel that multiple images generated with the same name. Now my ...
2
votes
1answer
11 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 ...
0
votes
0answers
16 views

Show categories when upload a featured image

When you upload an image in the media library, you can add categories in the process. Is it possible to show categories when you are editing a post and add a feature image. In this case, when you ...
0
votes
0answers
18 views

Wordpress Classic Editor is removing image captions

we noticed that on our Wordpress (5.7) image captions are removed after we open post in the editor and change something (or only switching to HTML tab and back). This part is removed: [caption id=&...
0
votes
0answers
13 views

Count for Media Library Attachments specified by Categories

I've added this function into my function.php file that allows me to specify images in my media library with categories. /* Add Categories for Media Library Attachments /*------------------------------...
0
votes
2answers
47 views

upload_max_filesize is set to 64 MB already but WordPress is still showing 2 MB

I have configured the upload_max_filesize directive to 64 MB in my localhost php.ini and have my Apache restarted. But why the Media section in my WordPress still showing 2 MB below? Maximum upload ...
0
votes
0answers
19 views

display image name in wordpress media library (grid mode)?

I would like the name of the images to appear in the grid view of the wordpress media page. is this possible from functions.php, to show the name of the image in the media page (grid mode)? many ...
1
vote
0answers
95 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 ...
0
votes
0answers
16 views

Disabling Media Library and Bypassing it

Actually I am facing an issue and I am new to WordPress. I want to disable the Media Library for non_admin Users. I want that the Users on my site can upload images without having to upload it through ...
1
vote
2answers
44 views

Audio file's length (duration) is missing from Attachment Details in Media Library [closed]

I'm uploading a different mp3 file to each post as an attachment and using wp_get_attachment_metadata() to print the duration of the mp3 file. Sometimes the response from wp_get_attachment_metadata() ...
1
vote
0answers
10 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; } ...
0
votes
0answers
27 views

How to prevent WordPress Media Library from removing image?

I have a custom post type that must have its feature image. Its feature image also appears in the Media Library where user can delete the image/attachment file permanently. But I want to prevent user ...
0
votes
0answers
85 views

function add custom fields to media gallery

I know this has been asked before but I'm having trouble with it and this seems poorly documented. My goal: Create a function that adds multiple custom fields into each item in the media gallery. ...
0
votes
0answers
46 views

Exclude image title from site search results

A user pointed this out to me recently and I've been scratching my head trying to figure it out. Currently the standard wordpress search box on my site is returning images in my media library in the ...
1
vote
1answer
18 views

Pulling images from a subdomain

I have created a sub-domain img.domain.com and in the database I have changed the required paths inserting the root and the url to this sub-domain. I have also changed these paths in options.php under ...
1
vote
0answers
25 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. ...
0
votes
1answer
19 views

Removing extra large generated images disables all crops

function filter_image_sizes( $sizes) { unset( $sizes['1536x1536']); // disable 2x medium-large size unset( $sizes['2048x2048']); // disable 2x large size return $sizes; } add_filter('...
0
votes
0answers
20 views

Save data is post using php front end

I'm newbie, i have a simple php file ,there is my data like, title, body content, feature image, category and 1 custom file I want to save this data in my post My coding look like this $title="...

1
2 3 4 5
19