The file types that you have specified ‘application/msword’, ‘application/vnd.ms-excel’, ‘application/pdf’ are already supported by media uploader.
To see the default supported mime file types, call wp_get_mime_types() function.
Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default.
Add following code in your themes functions.php file
// Add the filter
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
// Add file extension 'extension' with mime type 'mime/type'
$existing_mimes['prc'] = 'application/x-mobipocket';
// and return the new full result
return $existing_mimes;
}
Related Posts:
- Duplicate Custom Header Functionality into the post edit screen
- Creating a metabox to upload multiple images, Ignoring The Featured Image
- Add metabox with media uploader in a custom post type [duplicate]
- Remove tabs from media uploader for a CPT
- How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page
- Image size filtering in Media uploader according to custom post type
- wp is not defined error using wp.media to create a custom image uploader
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Force documents to appear in Featured Image dialogue
- How to Create an Image Upload Box for Custom Posts?
- Checking if $_FILE isset for an array of file upload metaboxes
- Create a custom post type for a photo post
- Invalid file type when using wp_upload_bits to upload PDF to a custom post type
- Insert into post button missing on custom post type
- Custom post type media upload error with custom user role
- How to change default position of WP meta boxes?
- Custom Taxonomy as checkbox or dropdown
- Hide “Add media”, HTML editor from TinyMCE
- Why won’t my metabox data save?
- echo value from ‘select’ field type into page template using cmb2?
- WP_List_Table Inside Metabox Not Working on Submit
- Attach Files Metabox
- How to hide CPT files from media library programmatically
- wp_generate_attachment_metadata gives me an empty array
- Best way to arrange custom post types by Attributes -> Order metabox value?
- Removing Edit Permalink/View “Custom Post Type” areas
- Unable to save custom taxonomy terms in a custom-built metabox
- How to sort CPT by custom meta value (date), and return posts month by month
- Rename the insert button in media upload window
- Possible to add meta box to edit.php pages?
- How can I include meta box content when searching?
- How to create a repeatable / reusable divs in the metabox?
- I need a Simple image uploader with a simple screen. WP default has too many options.
- Upload Image from Front End and Resize
- MP3 Manager for WordPress
- How to rename image at uploading on specific plugin or post-type in WordPress
- How can I display my custom metaboxes on a custom post template?
- Custom Post Type with metaboxes (no content) only?
- Unable to show meta box data in frontend
- Remove fields on media uploader for custom page type – not working for “From Computer” or “From Url” tabs?
- Using My-Meta-Box-Class plugin, how is ‘Date’ value stored?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- What is the best way to correlate one-to-many content-type relationships?
- Visual editor issue by having multiple tiny mce editors in a CPT
- A better way to add a meta box to custom post types
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Grouping metadatas into one
- Anon function and add_meta_box
- Listing custom terms in custom post meta
- Can custom fields be added without a meta box?
- How to add meta box for image upload using WordPress media uploader?
- Meta Box on Custom Post Type not saving
- How to add multiple images to a custom post type without plugin [closed]
- Moving meta boxes in admin
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- custom post type metaboxes not saving
- Custom post type, have only my meta boxes
- Display Repeatable Meta Box Content
- Saving Meta Data within Custom Post Type
- Values from meta-box not on $_POST
- Metabox multiple custom post select -> display selected items?
- Get id from metabox dropdown
- Custom posttype content metabox
- Reusable metabox backend and frontend
- How can I output WPAlchemy repeating fields meta values in my page template?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Meta box data not saving
- Questions regarding add_meta_box()
- Related posts meta_query CPT
- Meta box with front-end styling
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot upload featured image to a custom post type
- Problem On Retrieving Post Meta Data on Custom Column [closed]
- Custom MetaBox : Food Menu Item Available Dates
- how to compare different timestamps in wp-query for events custom post types?
- Metaboxes inside Tab
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Create post meta box that links another post
- Show a custom post title in another custom post type in Meta box
- Modify Publish Metabox location on CPT
- PHP Warning with Custom Fields
- Custom taxonomy with custom post type archive page
- Wrong post ID in meta box callback
- Metabox messes up permalink
- How to shows CPT which has specific meta key?
- Render the metabox input values as HTML
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Delete custom post type metadata without deleting the post in admin area
- Metabox is not saving
- How to check if meta box value is false for all posts then do something based on that
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Display a post count from a custom metabox selection
- Select custom post by meta value
- Make meta box appear if the previous if not empty?
- Custom post type – permalink
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- How to query custom post then display sections by meta value
- Display div based on Group metabox selection [closed]
- How to consume external API from WordPress post editor and display the response data in the custom field?