Questions tagged [media]

An image, audio or a video comprises a media.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

add_attachment hook Gutenberg

[UPDATE] Well, I was firing add_attachment into a conditional statement is_admin(), I suppose this is wrong. I am using the following code to fire when a new media is uploaded into the Media library. ...
0
votes
0answers
13 views

connect wordpress and Google photos? [closed]

I can upload photos from my computer to my wordpress website. I would like to also upload photos directly from my google photos. Is that possible?
1
vote
1answer
35 views

Create a new post using rest api and save featured image using an external image url

I am trying to create a post using the rest API. Which I am able to do with a fetch request as below. OurPostData contains the title, content and URL of a featured image which is an external url ...
0
votes
1answer
25 views

Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?

I am working on a plugin that gets image URLs from an API, some being PNG, JPG, and others JPG without an extension. I've been trying to use a combination of download_url() and media_handle_sideload() ...
0
votes
1answer
10 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
1answer
14 views

Thumbnail images chopped off but not cropped to exact dimensions

In Media Settings I have Thumbnail sizes set to width and height of 150 and "Crop thumbnail to exact dimensions (normally thumbnails are proportional)" is not checked. Since the checkbox is ...
1
vote
0answers
17 views

Restrict media upload size by format

I'm looking for a way to restrict the size of the media when uploading (a plugin or just a function). So I found this: function increase_upload_size_limit( $limit ) { return 524288; } add_filter( '...
0
votes
1answer
17 views

Upload media only to DB

I'm using the latest WordPress (5.6) and from what I've found out there's no visible setting for uploading media directly to a DB. Is there such an option somewhere hidden or does WordPress not ...
0
votes
1answer
10 views

where can i add custom script to stop header video from autoplay

How can I add the custom script from this answer to my site to stop the custom video header from autoplaying? $( document ).ready( function() { $( document ).on( 'wp-custom-header-video-loaded', ...
1
vote
0answers
28 views

media_handle_upload() progress bar

I'm using the media_handle_upload() function to upload several type of file in the media section of Wordpress Backend. Is there an easy way to have a progress bar linked to this function to give some ...
0
votes
0answers
20 views

WP Rest API Media Upload is Successful But Returns 500 Error

I was able to successfully upload an image via the WP Rest API using the following code: $this->guzzle_client->post( $this->trailingSlashIt( $this->url ) . $this->...
1
vote
0answers
21 views

WordPress: cleaning media library

I'm giving my website a clearout whilst I redesign it, and thought I'd delete a bunch of old images from the media library (about 50 or so). I thought this would free up a lot of space, but now I see ...
0
votes
0answers
15 views

Update media using REST API

I am trying to update media items data (title and ACF fields) using the REST API. I am trying the same method that I successfully used to update ACF data for post types. But it isn't working for media....
0
votes
1answer
13 views

Flat media folder vs multiple directories

I recently took over a website that uses a flat media folder in the site root. Is there a benefit to that over using the standard WordPress media folder structure of uploads/year/month/file? We have ...
1
vote
0answers
25 views

How can I get the media inside a post?

I’m new to WordPress, so please forgive me if my question is not clear or vague. I did a lot of research, but I didn’t figure out how to do the trick. I’m developing a Xamarin application for Android ...
0
votes
0answers
7 views

When a route is matched with media attachment it shows that and ignores my routing

I have custom routes using routes everything works fine, my problem is when a media is inserted it always bypass my routing. For example: domain/route1/internal-id if there is any media that matches ...
0
votes
0answers
9 views

WXR file - Media import failed - how to force import?

Say I have one Wordpress A that I want to move to Wordpress B (different IP addresses, different servers, different subnets). Server A is behind a private IP address. When selecting export function on ...
0
votes
0answers
31 views

add mediaelement.js plugins into WordPress video player control bar

im trying to add SkipBack and JumpForward Plugin of mediaelement.js into my wordpress [video] tag controlbar. so far i have added those to plugin js in a js file (videoplayerjs) like this : /*! * ...
0
votes
1answer
23 views

Is there a way in WordPress to convert images to WebP without a plugin?

I'm building a simple WordPress theme for personal use. Speed is important. My Google PageSpeed Score is high, but it keeps saying that I should use WebP, rather than JPG. ('modern web formats'). As I'...
0
votes
0answers
12 views

Put images in the media from url functions

When the client installs my theme I would like to automatically download images and add them to the media library, e.g. from links like this: https://images.pexels.com/photos/2228559/pexels-photo-...
1
vote
0answers
11 views

Multisite - Images often getting uploaded to the wrong month directory

Previously I had only a single site enabled but recently enabled a multisite option. Now the issue is that the images are getting uploaded in the wrong month directory. It should be uploading to 11 ...
2
votes
0answers
200 views

How to change upload directory based on frontend form input name or ID?

I created a frontend form using a plugin which allows logged in users to create draft posts. There are 3 file upload areas. I need 1 of them to use the default public WP media upload folder as usual. ...
0
votes
0answers
8 views

Stop generating thumbnails for a specific folder

I reduced unnecessary thumbnail sizes using a plugin. But there's also a media folder that I do not want thumbnails to be generated at all. Is there a way to stop Wordpress from generating thumbnails ...
0
votes
1answer
62 views

Can't upload format files on media library

I have an issue for uploading .ppsx format on the media library. all the powerpoint format (pptx ppt, pps) can be uploading without problem except the .ppsx format and i don't know why. when i try to ...
0
votes
1answer
23 views

Upload error on localhost (at minimum, not yet tested online)

uploading a picture on localhost I keep receiving following error: Post-processing of the image failed likely because the server is busy or does not have enough resources. stopping any upload, even ...
0
votes
1answer
831 views

Wordpress media upload issue could not insert attachment into the database

Could not insert attachment into the database. When ever I try to upload new images from WordPress media it shows me above error. Please help me why wp database shows this error.
0
votes
1answer
21 views

How to add HTML into error message

php I have a filter for limit max upload file size with custtom message. I want to add link there, but html does not work here. Can you help me someone? Here is my code add_filter("...
0
votes
0answers
31 views

WordPress Media upload return async-upload.php error 404

When I try to upload a file bigger than 120MB, I have this error on my console : POST https://www.website.com/wp-admin/async-upload.php 404 I have checked with FTP and the async-upload.php file exists....
0
votes
1answer
17 views

Built-in image lazy loading: Does it come with a polyfill for older browsers?

It's neat that WordPress now automatically adds the loading="lazy" attribute to images. My question is: Does WP now also have a built-in JS polyfill for browsers that don't support the ...
0
votes
0answers
10 views

How to upload multiple images to multiple posts?

I imported an old XML file to a WordPress page. It has 2000+ posts but it doesn't have pictures, and I have to add pictures to all the posts. Of course, uploading and adding 2000+ pictures takes too ...
0
votes
1answer
20 views

Move media files from the root to date folder structure

How to move existing media files fro the root of the uploads folder to subfolders or date structured folders?
0
votes
0answers
22 views

How to extend WP_Widget_Media

I am new to WordPress theme development. I'd like to create a new widget based on the built-in Image widget, with additional fields such as 'description' & 'speaker'... etc. The widget is called '...
0
votes
0answers
26 views

Getting image data from phone camera (MediaDevices.getUserMedia) into user post

Sorry for the newbie, and poorly arranged question... I'm trying to develop a super simple user based wordpress site. I want logged in users to take a photo with their phone which is then uploaded as ...
0
votes
0answers
17 views

How to change Route respond To A specific Path?

To increase site loading time and decrease the pressure on my website I have decided to host files(js,css,images) in other hosting, like google storage or amazon aws, problem is that I already ...
1
vote
0answers
27 views

WordPress automatically downscaled images larger that original

I have a real head head-scratcher. I am trying to boost the performance of my wife's website. One of the things I identified as potential issue was the size of image files. I am somewhat aware photo ...
0
votes
0answers
7 views

Method or plugin to show list of available videos

I need some way to list available videos in a wordpress page. The result should be a JSON, RSS or similar, where people can choose, which video should be exposed. Has someone a snippet where I can ...
0
votes
1answer
21 views

Automatically Insert alt attribute above image has h2

When inserting an image in a WordPress post, I would like that it automatically add the alt text of the image above the image as h2. Example, when inserting an image, WordPress ads this into the post: ...
0
votes
2answers
44 views

SVG not displaying in Media Tab in Backend

I addes this code to allow SVG Uploads to the Media Library of wordpress: function upload_svg ( $svg_mime ){ $svg_mime['svg'] = 'image/svg+xml'; return $svg_mime; } add_filter( 'upload_mimes', '...
0
votes
0answers
21 views

media_sideload_image not working as expected, creating duplicate uploads

I'm working on a WordPress + woocommerce website, and the site has a custom built plugin (not built by me) that uploads product images from AWS to woocommerce. Lately there has been some trouble with ...
0
votes
0answers
9 views

Media not loading for some custom roles

I can't see my media library for my custom role "restricted user". The capabilities works well for the rest, but I can't see any image in my library (with this role only). The ajax loading ...
0
votes
0answers
17 views

How to limit access to media library using wp.media on the frontend?

I am trying to make a frontend page for my plugin where users can create a post (CPT) and attach a thumbnail to it. I call wp_enqueue_media(); and use this HTML in the form: <div> <label ...
0
votes
1answer
24 views

Media Library modal customization

I have a fashion website and I use a large amount of images on my website, As I add new products I should add product images and for that I use media library modal but the problem is working with ...
0
votes
0answers
24 views

Get all uploaded images using REST api

I need to get all the images that are uploaded in my wordpress installation using the REST API. I've tried using the wp-json/wp/v2/media endpoint but it will give me only the last 10 images uploaded ...
0
votes
0answers
47 views

Change any image file format to 'webp' during media upload (with thumbnails in 'webp') and return the file path in the 'webp' format

I want to change the file format of any jpg/png/gif image uploaded (through media library / post featured image / gallery and wherever else applicable) to webp format (along with the thumbnails). Only ...
0
votes
0answers
7 views

Thumbnails not displaying on web page

I have been struggling with correcting this error for a while now, I have no idea as to what is causing it. The posts thumbnails are not displaying on the page, however the pictures in the posts are ...
1
vote
0answers
54 views

How to search media library alt text and title fields

I need to be able to search in the WordPress media library alt text and title fields. I've previously used a plugin called Media search Enhanced by 1fixdotio (https://wordpress.org/plugins/media-...
1
vote
0answers
13 views

How to open default wp image editor screen dynamically?

I'm displaying gallery images of the logged-in users on the frontend with the edit button. Now I want to link that edit button with the default WP Image Editor screen that includes tools like crop, ...
0
votes
0answers
16 views

Wordpress media has all disappeared on wp-admin but still on the server

I realise this is a very common problem and I have done all the basic debugging - deactivating plugins, changing to 2020, permalinks and various fixes have been suggested. None have worked so far. ...
0
votes
1answer
17 views

Which post/page an image is attached to

When I filter by unattached in the Media Library, it returns images that are used in posts and pages. Are there ways to see which specific posts/pages an image is attached to?
0
votes
0answers
16 views

How to delete all the resized images without plugin

Images on my wordpress site are talking 1.4 gb space. I'm sure Used Original images space is not more than 300-400mb. So i want to remove resized images so my site's backup can be light. i used many ...

1
2 3 4 5
21