This article describes how wordpress only supports image uploading. you can use a custom function to upload images. other files are not allowed to be uploaded. For more information, see. Wordpress supports uploading images When adding an article, wordpress supports adding media, including images, videos, word, excel, and other multimedia files. Obtain all types of files that wordpress supports uploading. you can insert the following php code in functions. php of the current topic. Then, open the blog home page, view the page source code, you can see a complete list of support (bbs.it-home.org script School): print_r (wp_get_mime_types ()); How can I make wordpress only support uploading image files? other files are not allowed to be uploaded. Insert: // add the filteradd_filter('upload_mimes', 'custom_upload_mimes');function custom_upload_mimes( $existing_mimes=array() ) { $existing_mimes = array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon'); return $existing_mimes; } You can only upload images and reject other files. |