By default, the MainWP File Uploader Extension doesn’t support all file types. By using the mainwp_file_uploader_allowed_file_types
filter, it is possible to add support for any file type.
In this example, we will show how to add support for the JSON file type:
- Install and activate the MainWP Custom Dashboard Extension
- Go to the PHP section (MainWP > Extensions > Custom Dashboard > PHP)
- Paste the following code snippet and Save Chagnes:
add_filter('mainwp_file_uploader_allowed_file_types', 'mycustom_mainwp_file_uploader_allowed_file_types'); function mycustom_mainwp_file_uploader_allowed_file_types( $types ) { $types[] = 'json'; return $types; }