Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#57270 closed feature request (invalid)

I want disable some Image Formats (Without Plugin)

Reported by: factstea's profile factstea Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.1.1
Component: General Keywords:
Focuses: Cc:

Description

Hi, Team

I am running a website over wordpress while using MagazineNP Theme. My website is accepting JPG, PNG and all other image formats. But I want enable only Webp format. How Can i do that without plugin?

I have added a code in additional CSS ::
==================================================
add_filter(‘upload_mimes’,’restrict_mime’);
function restrict_mime($mimes) {
$mimes = array(
‘webp’ => ‘image/webp’,
);
return $mimes;
}
==================================================
But it dosent work. Please help me out in this. I want enable webp format only for images. Whenever anyone try to upload anyother fotmat image then should not be done and he should see a massage something like, You can upload webp only or only webp is supported.

I do not want make changes in docs like pdf, wordfile or etc. I want change in Image format only.

Thanks
FactsTea !!

Attachments (1)

Image Format.png (69.0 KB) - added by factstea 2 years ago.

Download all attachments as: .zip

Change History (2)

@factstea
2 years ago

#1 @peterwilsoncc
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @factstea, welcome back to Trac.

Trac is for the development of the WordPress Core software. Head on over to the Developing with WordPress support forums to ask for some help with your queries.

The support section of WordPress.org is where you will find people best able to assist you with running your website.

I'll close this ticket as invalid, as there is no action we can take here on Trac.

Note: See TracTickets for help on using tickets.