Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created September 20, 2024 08:03
Show Gist options
  • Save KaineLabs/587509de71ed4e3b6d26fcfe1d0e004d to your computer and use it in GitHub Desktop.
Save KaineLabs/587509de71ed4e3b6d26fcfe1d0e004d to your computer and use it in GitHub Desktop.
Storio - Extend Stories Plugin Upload Extensions
<?php
// Storio - Extend Stories Plugin Upload Extensions
add_filter('upload_mimes', 'storio_custom_upload_mimes');
function storio_custom_upload_mimes($mimes) {
$custom_mime_types = array(
'json' => 'application/json',
'xml' => 'application/xml',
'txt' => 'text/plain',
'avif' => 'image/avif',
'gif' => 'image/gif',
'jpg' => 'image/jpeg',
'png' => 'image/png',
'webp' => 'image/webp',
'svg' => 'image/svg+xml',
'pdf' => 'application/pdf',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
);
return array_merge($mimes, $custom_mime_types);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment