I have general question to group of WP themes that allow creating a classified ad websites.
I would like to know which file/part of code/function is responsible for restriction of attachments. These themes allows only images to be attached to the posted ad.
My aim is to expand allowed files format adding the 3d-model files (like .stl, .obj) that cant be execute on the server site and cannnot harm the server.
Thanks in advance
I have general question to group of WP themes that allow creating a classified ad websites.
I would like to know which file/part of code/function is responsible for restriction of attachments. These themes allows only images to be attached to the posted ad.
My aim is to expand allowed files format adding the 3d-model files (like .stl, .obj) that cant be execute on the server site and cannnot harm the server.
Thanks in advance
I think this may be what your looking for. Below are a few examples of altering the default file types allowed by WordPress. Keep in mind that some hosting companies will disallow some file types.
Allow All File Types
Add the following to wp-config.php to allow for any file type.
define( 'ALLOW_UNFILTERED_UPLOADS', true );
Allow or Disable Specific Types
Add the following code into your theme's functions.php
function my_custom_mime_types( $mimes ) {
// New allowed mime types.
$mimes['svg'] = 'image/svg+xml';
$mimes['svgz'] = 'image/svg+xml';
$mimes['doc'] = 'application/msword';
// Optional. Remove a mime type.
unset( $mimes['exe'] );
return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types' );
Resources
Allowed mime Types
List of mime Types
Plugins
WP Add Mime Types
Disable Mime Check