wp_check_filetype() 함수가 없다는 에러가 나올 때

wp 에서 파일 첨부 중 wp_check_filetype(); 함수가 없다는?에러가 떴다.

해당 함수가 들어있는 파일은?wp_include/function_post.php

해당 파일 마지막 부분에 다음 함수를 추가한다.

 

function wp_check_filetype($filename, $mimes = null) {
// Accepted MIME types are set here as PCRE unless provided.
$mimes = is_array($mimes) ? $mimes : apply_filters(‘upload_mimes’, array (
  ‘jpg|jpeg|jpe’ => ‘image/jpeg’,
  ‘gif’ => ‘image/gif’,
  ‘png’ => ‘image/png’,
  ‘bmp’ => ‘image/bmp’,
  ‘tif|tiff’ => ‘image/tiff’,
  ‘ico’ => ‘image/x-icon’,
  ‘asf|asx|wax|wmv|wmx’ => ‘video/asf’,
  ‘avi’ => ‘video/avi’,
  ‘mov|qt’ => ‘video/quicktime’,
  ‘mpeg|mpg|mpe’ => ‘video/mpeg’,
  ‘txt|c|cc|h’ => ‘text/plain’,
  ‘rtx’ => ‘text/richtext’,
  ‘css’ => ‘text/css’,
  ‘htm|html’ => ‘text/html’,
  ‘mp3|mp4’ => ‘audio/mpeg’,
  ‘ra|ram’ => ‘audio/x-realaudio’,
  ‘wav’ => ‘audio/wav’,
  ‘ogg’ => ‘audio/ogg’,
  ‘mid|midi’ => ‘audio/midi’,
  ‘wma’ => ‘audio/wma’,
  ‘rtf’ => ‘application/rtf’,
  ‘js’ => ‘application/javascript’,
  ‘pdf’ => ‘application/pdf’,
  ‘doc’ => ‘application/msword’,
  ‘pot|pps|ppt’ => ‘application/vnd.ms-powerpoint’,
  ‘wri’ => ‘application/vnd.ms-write’,
  ‘xla|xls|xlt|xlw’ => ‘application/vnd.ms-excel’,
  ‘mdb’ => ‘application/vnd.ms-access’,
  ‘mpp’ => ‘application/vnd.ms-project’,
  ‘swf’ => ‘application/x-shockwave-flash’,
  ‘class’ => ‘application/java’,
  ‘tar’ => ‘application/x-tar’,
  ‘zip’ => ‘application/zip’,
  ‘gz|gzip’ => ‘application/x-gzip’,
  ‘exe’ => ‘application/x-msdownload’
));

 $type = false;
 $ext = false;

 foreach ($mimes as $ext_preg => $mime_match) {
  $ext_preg = ‘!.(‘ . $ext_preg . ‘)$!i’;
  if ( preg_match($ext_preg, $filename, $ext_matches) ) {
   $type = $mime_match;
   $ext = $ext_matches[1];
   break;
  }
}

return compact(‘ext’, ‘type’);
}

 

하고 났더니 세이군이 -_- 2.0.6 한글판 만들어줄 테니 쓰라고 한다. 글쎄, 하는 것 봐서 ^^;;(튕기는중)

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.