How does wordpress support Image uploading?

Source: Internet
Author: User
How does wordpress support Image uploading?
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.