admin管理员组文章数量:1130349
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
Share Improve this question asked Dec 18, 2018 at 7:24 SWESWE 11 bronze badge 2- You're going to need to ask their authors. They probably all do it in a different way. – Jacob Peattie Commented Dec 18, 2018 at 7:30
- I have talked to one developer and he said that this group of themes have very similar function structure. I'm just new to Wordpress as well as i am very beginner at modifying code so i would like someone proficient to just show me the direct what i should looking for. – SWE Commented Dec 18, 2018 at 7:41
1 Answer
Reset to default 0I 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
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
Share Improve this question asked Dec 18, 2018 at 7:24 SWESWE 11 bronze badge 2- You're going to need to ask their authors. They probably all do it in a different way. – Jacob Peattie Commented Dec 18, 2018 at 7:30
- I have talked to one developer and he said that this group of themes have very similar function structure. I'm just new to Wordpress as well as i am very beginner at modifying code so i would like someone proficient to just show me the direct what i should looking for. – SWE Commented Dec 18, 2018 at 7:41
1 Answer
Reset to default 0I 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
本文标签: themesHow to change allowed attachment files extensions
版权声明:本文标题:themes - How to change allowed attachment files extensions 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749087540a2314008.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论