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
0
votes
1answer
16 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
23 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
27 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
24 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
20 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
20 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
9 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
14 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
38 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
12 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
16 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
19 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
27 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
21 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
19 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
18 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
15 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
10 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
35 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
18 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
37 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
15 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
30 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
6 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
15 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
65 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
34 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
12 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
18 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
18 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="...
0
votes
0answers
16 views

Thumbnail (featured image) and Media Library cleanup queries help needed

I inherited a website that was started 13 years ago, over the years the version of WP and themes have been kept current, however much of the older content (and there is a ton of it) was created long ...
1
vote
0answers
27 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....
1
vote
1answer
26 views

Not able to extend wp.media.view.AttachmentsBrowser

New to WP development here so please bear with me if I'm missing something simple... I am writing a plugin for the Media upload library which needs to get the selected media items in Grid View (for ...
0
votes
1answer
45 views

Filter media library by custom postmeta

I am using ACF plugin. I created a select field custom_select on ACF that is included to every attachment. ACF writes these values in the postmeta table. I now want to filter my attachments in my ...
1
vote
1answer
16 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 (...
0
votes
1answer
19 views

Two problems that are likely related to AJAX

Guys. I started a new WP website about a month ago. Recently, I ran into two problems that I suspect have something to do with AJAX but I'm not sure. The first problem is the Media Library showing no ...
0
votes
0answers
14 views

Is there an easy way to create a duplicate of a media library image?

In many cases WordPress Thumbnails are fine for displaying a smaller version of an image, however there are quite a number of tools which don't allow the choice of displaying a thumbnail, so an ...
0
votes
0answers
12 views

Media Library Cleanup A Thought Exercise

I have a site with roughly 1200 posts. Each post has a featured image and a few placed images in the content. Over the years we have had a bad habit of using the WordPress image editor to crop and ...
3
votes
0answers
37 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 ' + ...
0
votes
0answers
15 views

Does using the WordPress Import tool still include attachment data if “Download and import file attachments” is not selected?

I'm in a unique situation where I have to import WordPress content into a production server, but I don't have SSH access to the server files or database. I can't install plugins on the production ...
0
votes
0answers
14 views

get_the_post_thumbnail() returning 404 for newly uploaded attachments in media library via thumbnail - filename discrepancy

Using get_the_post_thumbnail($post->ID,'thumbnail') to generate the thumbnails for a display. This was working for a very long time, but now we have switched an image on a post, and the URL ...
1
vote
1answer
38 views

Custom Media Modal and uploading

I am trying to add a unique custom tab to the Media Uploader using this code. var customMedia = wp.media({ state: 'customState', states: [ new wp.media.controller.Library({ ...
0
votes
1answer
12 views

Attaching a file to a page without adding to media library?

We are using WP for our new intranet, which will primarily be used for documentation and archiving. We have some pages where we want to attach PDFs, documents, images, etc. However, we do not want ...
0
votes
0answers
10 views

how to show authors their own posts and media files which they upload and and change some so their capabilities

how to show authors their own posts and media files which they upload and change some so their capabilities I also want to hide a plugin from authors panel in wordpress
0
votes
1answer
15 views

Do I need to re-register all my images in the media library after a migration?

I'm moving a 6+ years running WordPress site to a new (Azure VM / LEMP) server, taking the time to upgrade Ubuntu, Nginx, etc, and trying to clean up years worth of grunge. ~20 authors, 40k posts, 6+...
0
votes
0answers
36 views

Optimise wordpress database using SQL after deleting registered images from Media Folder

I have used Media Cleaner Pro Plugin to clean few batches of registered images. Additionally i have updated my functions.php so these unused images will not be generated in future. function ...
0
votes
0answers
11 views

Change caption length for image/image carousel

I'm looking for a way to change the number of characters displayed for caption in frontend page. for example i have this caption text : "WordPress is a free and open-source content management ...

1
2 3 4 5
19