Created
February 26, 2024 19:27
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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