遵循以下指南后How can I prevent uploading bmp image? 为了将bmp(在我的例子中还有tiff图像)从上传中删除,我进行了测试,它正在工作,但注意到用户现在收到了错误消息:
Sorry, this file type is not permitted for security reasons.
screenshot-with-shadow.png http://img813.imageshack.us/img813/4526/screenshotwithshadow.png
看起来是在wp-admin/includes/file.php
文件夹:if ( ( !$type || !$ext ) && !current_user_can( \'unfiltered_upload\' ) )
return $upload_error_handler( $file, __( \'Sorry, this file type is not permitted for security reasons.\' ));
再往下看:if ( ( !$type || !$ext ) && !current_user_can( \'unfiltered_upload\' ) )
return call_user_func($upload_error_handler, $file, __( \'Sorry, this file type is not permitted for security reasons.\' ));
我怎样才能连接到这一点上,以便将消息更改为更友好的内容?