参数 $typestring必填 附件类型。接受'image'、'audio'或'video'。 $postint|WP_Post可选 附件ID或对象。默认值为全局$post。 默认:null 返回 bool 如果是接受的类型之一,则为true,否则为false。 相关使用描述get_post()检索给定ID或对象的文章数据wp_check_filetype()wp_get_video_extensions()wp_get_audio_extensions()get_attached_file()被使用描述wp_attachment_is_image()判断附件是否为图片wp_insert_post()插入或更新一篇文章register_and_do_post_meta_boxes()WP_Widget_Media::is_attachment_with_mime_type()get_oembed_response_data_rich()wp_generate_attachment_metadata()edit_form_image_editor()wp_ajax_send_attachment_to_editor()wp_ajax_save_attachment()prepend_attachment()wp_enqueue_media() 源码查看源码 官方文档 更新日志版本描述4.2.0开始引入