Skip to content

Instantly share code, notes, and snippets.

@abdulawal39
Created February 26, 2024 19:27
Show Gist options
  • Save abdulawal39/4d01d04ab0b25af95d0a687740f6bc22 to your computer and use it in GitHub Desktop.
Save abdulawal39/4d01d04ab0b25af95d0a687740f6bc22 to your computer and use it in GitHub Desktop.
Fix for html files not working with file type setting of wp file access manager.
/**
* It has to be overwriten in the plugin file manually unfortunately.
* For some reason, the standard wp function for checking mimetype does not return proper value for the html or htm files.
* Thats why the following function needs to be edited to fix the issue.
* The file is inside includes folder named helper-functions.php
* Simply find the function named get_file_mime_type and replace the whole function with the following.
*/
function get_file_mime_type( $file_path ){
$mime = mime_content_type($file_path);
return $mime;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment