wp_generate_metatadata()
should create metadata for image, video, and audio file types. There is and if
/elseif
conditional in the source that limits the function to those three. However, the last line is:
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
So you could use the wp_generate_attachment_metadata
filter to generate the metadata you want. There are plenty of answers here about creating filters, not to mention the Codex.
It is hard to say much more as you don’t specify so much as what kind of “non-image” file you have.
Related Posts:
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- simple solution for restricting access to (some) uploads/downloads
- Saving images from Gravity Forms repeatable File Upload as post attachments [closed]
- How to get all files inserted (but not attached) to a post
- Password protect some uploaded files, so only logged-in users can view them
- How to check if an image attachment exists before uploading
- File upload from front-end form (as attachment) not working
- Add suffix to filename of uploaded images
- Check if image exists before uploading with media_sideload_image()
- Add a YouTube or Vimeo video as a post attachment?
- How can I save the original filename to the database?
- ACF attachment custom field in rest response
- How to solve: An error occured in the upload
- Images not being generated at correct size
- How to manage a big collection of files with wordpress?
- Use the WP media uploader dialog for uploading a form attachment (non-admin). Offering progress and drag and drop feedback
- Rename attachment filenames to attachment ID on upload
- What is the way to add additional fields to attachments in 3.5+?
- How to edit attachment with media-upload.php?
- Upload iPhone video clips to blog via native WP app
- How to load attachment in media library for current user?
- How does WordPress decides how many sizes of an image to create?
- Upload and attach to a post multiple image files [closed]
- How to add filetype to meta value when using wp_upload_bits?
- Insert attachments from custom uploader into post (regular uploader style)
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- PDF Upload from Input Error
- Do custom post type (CPT) attachments/media store the parent post ID?
- Using unzip_file() to get contents of file
- What is wrong with my wp_insert_attachment code?
- Adding attachment custom field metadata to TinyMCE tag
- Updating the attachment from front end doesn’t show the new change
- Set attachment category from file name on upload
- “Could not write file” error in wp_upload_bits function
- _d_improd_ directory in uploads breaking site images
- Check if author or uploader id of the attachment(uploaded) image is match?
- Limit attachment caption characters
- controlling whether upload is attached to post or not
- How to force attachment size for every post
- Attachment Metadata not updated while uploading audio files
- Upload file to front-end form and send as email attachment
- Limit number of uploaded attachments of specific context
- How do I protect my uploads?
- How do I update attachment urls after changing site domain
- How to properly move media files and update data?
- Saving Media – Which Hook is Fired?
- How to restrict access to uploaded files?
- Is it possible to allow zip files to be uploaded in WordPress?
- Set a maximum upload count for users on a specific user role
- Append button to WordPress Image Details modal
- Importing WordPress Attachments Into Custom Directories In wp-content/uploads/
- add_image_size creating lots of images (of various sizes)
- This file type is not allowed. Please try another
- File Upload Permissions
- Setting the uploads directory
- Retrieving JSON data in ajax request from media uploader
- insert post & Upload post thumbnail from the front end using ajax
- how can i simple change upload folders to %year%/%month%/%day%?
- Regenerate thumbnails unexpected resolution (96 x 96)
- How to host different file formats/types for a media attachment without creating multiple attachments?
- Change default from “Attachment post URL” to “File URL” in Add Media
- how to use media library [closed]
- Adding Adobe files to a wordpress site [closed]
- Copying uploaded images not working in wordpress
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Manual filename while uploading attachments
- Can’t manipulate media uploads
- Symbolic link for uploads in wordpress
- Large image upload size (using timthumb.php
- How can I manage and limit disk usage for each author?
- How would I change the 10 MB limit to 5 GB in this script?
- Media Library Won’t Display Any Images
- When does WP resize an image file
- How can I modify the media upload form fields?
- More Fields & Media Upload
- “Sorry, this file type is not permitted for security reasons.”
- Upload multiple image with media_handle_upload with multiple file field [duplicate]
- Upload PDF and other files from the Front-End
- How to disable image thumbnails from media manager but not post media uploader?
- Get uploaded video URL
- How Do I Change the File Permission For Uploaded Files in WordPress?
- image not display in media library and thumbnail not display in post
- How to upload .tex files in wordpress?
- An error occurred in the upload. Please try again later
- Using Gravity Forms to upload media into library, then attach to post
- Some images not appearing after switching from AWS S3 back to local
- Why I am not able to upload media files?
- Featured image to grayscale with PHP imagefilter – which hook to use?
- Store uploads on an external server?
- Force relative path in media library for LAN deployment
- Make thumbnail from uploaded image without plugin
- Making Site A Use Site B’s wp-content Folder
- Set featured link not showing
- increase maximum upload file
- How i can upload images to another folder?
- make default upload folder year/month/day wordpress without plugin [duplicate]
- Display Image Upload from Contact Form 7 on Redirect Page [closed]
- media_handle_sideload() fails
- How to upload and add images to the existing post from the front-end with admin approval which is posted by other user
- Obtaining detailed error information from Media file upload process