Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [media]

An image, audio or a video comprises a media.

0
votes
0answers
9 views

Customize Add Media screen

When using the Add Media screen from posts and pages, I'd like to group a few of the options (added by NextGen Gallery but not used very often) into sections that can be opened and closed like ...
0
votes
1answer
13 views

Thumbnail images missing in WP media library

I have built my own WordPress theme and applied it to my WordPress website. The issue I am having is out of the blue, the thumbnail images from the media gallery have stopped loading in and now just ...
0
votes
0answers
13 views

Attachment metadata has value of '1'

While accessing /wp-json/wp/v2/media endpoint I'd got an error 500. Checking the logs, I'd seen the following issue: PHP Recoverable fatal error: Object of class stdClass could not be converted to ...
0
votes
1answer
12 views

Creating multiple instances of Media Uploader

I have added the Media Uploader to our plugin, but it is creating multiple instances somehow. The Model is created twice. One with the configurations and one appears to be the default instances. I ...
0
votes
1answer
20 views

How can to use the players from the Media Widgets in the body of a post to play audio and video files

I've been trying to use the <audio> tag to play MP3 files and the <video> tag to play MP4 files, both with the controls attribute, and they work fine, but it isn't possible to apply custom ...
0
votes
0answers
13 views

How to manually set an attachment in a post?

I need to manually set an attachment in a estate post with custom php. When it was the wordpress that inserted the image into the media library, this image appears in the post on frontend. However, ...
0
votes
0answers
18 views

How to display more audio file ID3 tags in WordPress

When adding an audio file to WordPress, it automatically takes the title, album, artist from the ID3 tags in the mp3 file. It uses these in the playlist and audio file attachment page. How can I make ...
0
votes
0answers
9 views

Media Library: Remove replace images of selected author

Bigger WordPress install here: ~14k posts, 20k images in media library (plus different image sizes - cropped & formats). Images are used - as featured image of multiple posts - inside content (...
0
votes
0answers
19 views

How to install/enable mediaelement.js plugins in WordPress

MediaElement.js has a lot of useful plugins, such as jump forward, skip back, speed, etc. From my understanding (please correct me if I am wrong) WordPress core contains only MediaElement.js -- ...
4
votes
1answer
74 views

Set default image link target in Gutenberg image block

I want to set the default target of the image block in Gutenberg to "Media File": I've found solutions for the classic editor, and one that appears to work for Gutenberg galleries by editing the ...
1
vote
1answer
23 views

Can I hide certain upload folders in media library [duplicate]

A Plugin ( download monitor ) saves uploaded files in a certain folder called "dlm_uploads" within the WP upload directory. All files are visible in Media Library. Unfortunately the upload path cannot ...
0
votes
1answer
30 views

Gutenberg Block: Image resolution

Using the media upload element I created a custom Gutenberg block, that includes an image upload button. Now I would like to achieve one of the following: When an image is selected, it should select ...
0
votes
1answer
41 views

How to wp_upload_bits() to a sub-folder?

I am using wp_upload_bits() to copy an obtained remote image... $upload = wp_upload_bits($file, '', wp_remote_retrieve_body( $get )); Image source example: https://logo.clearbit.com/starcomww.com ...
0
votes
0answers
32 views

After migrating media library is not showing thumbnails

We are currently running a script to migrate from a custom CMS to WordPress. Everything is going perfectly well except for the "media manager". The media is all stored on a S3 bucket. Here is a ...
0
votes
1answer
27 views

Handle image file and save it to media

I have function that gets uploaded file, save it, then crop it with imagecrop and now I need to save it again to the media. I know the way, how to do that with vanilla PHP, but I need file to be ...
0
votes
0answers
15 views

Moving attachment postmeta rows to new database

I am moving a lot of content from one existing (and damaged) Wordpress installation to another existing installation. I am trying to bring the media library attachments into the new site, but when I ...
0
votes
2answers
11 views

Attach media to multiple posts

I have a simple code where I am attaching existing in the library image to a post: function attachToPost($attachmentId, $postId){ return wp_update_post(array( 'ID' => (int)$...
0
votes
0answers
11 views

Is there an after or before_remove_product_image hook? [on hold]

I am using WooCommerce and want to change some custom meta for the product thumbnail when it is unattached, so I searched everywhere for an action that fires when you "remove product image", or ...
0
votes
0answers
23 views

Use Remote URLs for WordPress Media Files

While it looks like this question has been asked before in some form, I still don't see a working solution. I am using WP Offload Media Lite which moves uploaded files to an Amazon S3 and then ...
0
votes
1answer
54 views

While Ajax is working well, media upload isn't showing the imagines

Look at the image below, it has no javascript errors, and media upload still spinning forever :( I tried to install new Wordpress, also disabled all plugins, googled several times, I tried to do it ...
0
votes
1answer
72 views

Add media with WP-Rest-API v2 II

I am having this exact question, asked in 2015, about adding media through the WP REST API. My code so far: curl -s -X POST http://www.example.com/wp-json/wp/v2/media/ -H "Content-Type: ...
0
votes
1answer
67 views

Fullscreen Video/GIF Intro

How would one go about placing a 3 second Fullscreen Video/GIF Intro upon website start up as a preloader. I've tried coding it in but there's always something conflicting and limits the ...
0
votes
0answers
25 views

Restrict media library uploads by user role

I'm currently using the "user role editor" pro plugin to restrict wp-admin features by user roles. I couldn't find any possibility to restrict media library upload by user roles. What I want is to ...
0
votes
0answers
13 views

Is there a way to edit slim down the appearance of the Add Media window in the post-new.php page?

I'm creating a photo gallery page for our "Author" user roles and I want to simplify the process of uploading photos. Right now, you can upload photos by doing this steps be selecting Add New Post and ...
0
votes
1answer
27 views

Adding attachment custom field metadata to TinyMCE <img> tag

I've successfully added a custom field to the media upload dialog, but now I need (1) this field to be present on the <img> tag on post content whenever an image is inserted, and (2) a way to ...
0
votes
0answers
20 views

Next and previous with wp_query

Hello i have huge problem, im creating website with huge ammount of images and i dont wanna use any plugins that gonna slow my site so i decide to make everything by myself. So everytime i add image ...
0
votes
0answers
6 views

Is There A Way To Auto-Stock Media Files To Every Site On A Wordpress Network?

I'm trying to find a way to upload images for everyone on my network to use, but I don't want sites sharing each other's media files. In other words, I want to stock sites with default media for them ...
1
vote
0answers
29 views

Image rotation and editing stopped working in Wordpress after upgrading Ubuntu from 16.04 to 18.04

I'm seeing this error in Wordpress Media editor: "Image rotation is not supported by your web host." I checked on my server and I have php7-gd: php -i | grep -i gd /etc/php/7.2/cli/conf.d/20-gd....
1
vote
1answer
23 views

Media library quick/inline edit

Posts and pages offers the opportunity for inline editing (Quick Edit), i.e like this. It is also possible for custom post types, but for some reason this is not offered for attachments/the media ...
0
votes
2answers
28 views

Multisite has SSL certificate, but media library is still http://

Our multisite WordPress installation has a URL of https://xx.com for the main domain, and - for example, https://yy.xx.com as a subsite. We're using WP's in-built domain mapping feature. Media ...
0
votes
0answers
16 views

How to upload 3 attachments to current post?

I have a form which updates a post but when updating I need to be able to also upload 3 posts: <div class="form-group"> <input class="form-control" type="file" tabindex="3" name="custom-...
0
votes
0answers
16 views

How can I change a media attachment URL/slug, so that I can use that slug for a page?

As in the title. Yoast is now installed so that all media page URLs redirect to the image itself, but how can I change that slug for the image? It's currently using the slug I'd like to use for a ...
1
vote
0answers
16 views

Limit number of images to upload in wp.media function

I need to edit a plugin for my website. The plugin uses wp.media function and lets user upload images from the frontend. A user should be able to upload multiple images. But, I need to set limit on ...
0
votes
1answer
23 views

MP4 file links download instead of playing

How can I make MP4 file download the file instead of playing it on wordpress?
0
votes
1answer
16 views

Sanitizing existing media library paths and page links from foreign characters

I'm migrating an old WP site that supported Swedish letters ÅÄÖ in the URL, thus the site has hundrets of images containing these letters. I've searched around and found various plugins that sanitize ...
1
vote
1answer
39 views

Auto delete pictures in media library by age

I want to auto delete images in the media library that are older than 3 days. Is there a method to do this?
1
vote
1answer
45 views

Cannot upload .mp3 file to wordpress media

I tried to upload a .mp3 file and wordpress rejected and display message: Sorry, this file type is not permitted for security reasons. This happened with some .mp3 file only. I'm using wordpress 4....
0
votes
0answers
16 views

Wordpress Search across media files

How can i extend the wordpress default front-end Search to search across audio file titles/captions as well?
0
votes
0answers
63 views

wp_delete_attachment doesn't delete image files / doesn't work

wp_delete_attachment should delete everything that is about attachment. However if I do wp_delete_attachment( (int)$delete_attachment_id, true ); The files remain on the server (even true should ...
0
votes
0answers
10 views

Add a option to select in Media Library to personalize how items are showed

Is that possible? I found that media-view.js creates a query and has six base type of queries based on items field in select element on the upload.php page. I saw that the scripts come from load-...
0
votes
0answers
40 views

Direct media library upload saving in wrong month date folder in custom theme

I have an issue in my custom theme. Direct media library upload saving in wrong month date folder (2017/03) when current date is 2018/09. But when I upload images through post it goes to the correct ...
0
votes
0answers
19 views

Capture mediaelement events

I'm trying to capture a couple of media element player events to no avail. There's a great API list of events available, but little documentation on how to implement. No examples. Here's what I've ...
1
vote
2answers
249 views

WordPress Issue : The uploaded file could not be moved to wp-content/uploads/

I have created a local WordPress 4.9.8 setup with PHP 7 inside a Fedora running machine. When I try to upload media into the WordPress admin, it keeps saying that The uploaded file could not be ...
0
votes
1answer
27 views

Setting an image as post header (not featured image)

I am not a WordPress expert and need your support. Is there a way to create a button just like Set featured image but that button will allow us to attach an image to a post (from gallery) as a meta ...
1
vote
1answer
13 views

Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically

For internal purpose, I'm looking for to convert (-) and (escape) sign to (_) automatically when we upload a file (photo,video,audio) on WordPress media library. Example: If i try to upload this 2 ...
0
votes
2answers
44 views

Generate links on all images in posts - is there a hook?

I am looking for a way to replace all links on images. Currently when a user clicks an image it links to the source file. What I want it to do is to ink to: example.com/editor=12&image=filename....
0
votes
1answer
25 views

Is there some way to find if media items are used anywhere on the site?

We have a large, old site that has long gone without care and attention, leading us to have several thousand media items, stretching back to 2014. While being tasked to clear up old media items, in ...
0
votes
1answer
98 views

How to bulk Edit Dates in Media Library?

I can't seem to find this option, but is there a way to bulk edit the dates of media items? I'm trying to go through my media and clean it up and I'd like to batch edit the dates of images (they'd be ...
0
votes
2answers
183 views

Getting alt text of featured image

I'm trying to get the alt text of our featured image and have it output on the frontend. Currently my code is <img class="vehicle-photo" src="<?php echo the_post_thumbnail_url() ?>" alt="&...
0
votes
0answers
9 views

Customize media uploader by user role

I am having a media uploader like below. I want to remove the sidebar on the left so that only portion below the visible. It can be done with css but i hoping that that there is some better way to ...