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
- Simple Data picker meta box
- Make it impossible to save a custom post type with both video and image selected?
- Dropdown of existing posts in a metabox
- Wrong post ID in meta box callback
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Metaboxes in Loop
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- php output of generated custom metabox
- check_admin_referer not working in custom meta box for custom post type
- Metabox messes up permalink
- Custom meta box data not saving
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Convert Custom Post Data to Javascript Array for Autocomplete
- Generating Custom Post Type list, within admin of another custom post type
- Collect custom post in a calendar
- How to retrieve custom post type permalink in another cpt?
- Custom meta box in editor of custom post type not working
- How to shows CPT which has specific meta key?
- Render the metabox input values as HTML
- Avoid another meta box in my custom post type
- Meta box not saving
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Create Custom Post Type PDF File (Like Media) Then Add Searchable Custom Fields
- Delete custom post type metadata without deleting the post in admin area
- Metabox is not saving
- Meta Box not being added in plugin
- Custom Upload Directory for Custom Post Types
- How to check if meta box value is false for all posts then do something based on that
- do action inside a class is not working
- How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?
- Custom metabox fields not saving when limited to a certain CPT
- CPT and metabox: create multi checkbox by using array?
- Unable to get the values for metaboxes for custom post type
- Search form to find custom meta box generated data
- Problem with ‘save_post’ hook not running
- How to make post page unique and show it on home page?
- Custom meta-box for all custom post types
- Edit post meta direct from post.php?
- How can i embbed two different galleries in custom post type
- How to Arrange Support => Thumbnail
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Add different meta box based on taxonomy
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Custom sortable pages on custom post type
- Repeatable WordPress custom fields in a metabox
- Meta-Box to add multiple items one at a time and on publish save all
- Toggle a metabox based on a selection
- Display a post count from a custom metabox selection
- WPAlchemy Metabox rewriting slug
- Custom metabox value not saving
- Add multiple custom meta boxes to different custom post types
- Custom post type Featured Image popup not working
- Displaying wp post categories into my custom metabox
- Yearly Archive from a custom date metabox (Event Start Date)
- Need to build custom metabox select prev posts by category
- adding a shortcode into a custom post type
- How to bring custom meta boxes to custom post types?
- Select custom post by meta value
- Make meta box appear if the previous if not empty?
- Filter CPT based on meta box value using Flexible Posts widget?
- Custom post type in submenu with custom meta box as a title with custom html
- Problems with a custom meta_box
- Add Metabox to all custom post types
- Adapting plugin for custom post type?
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- Loading one meta box only on post-new.php with a forward link
- Custom post type – permalink
- Textarea type on one field custom add_meta_box?
- Saving custom metabox data with a twist
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- loop through custom post-type with two meta_keys
- Extending a CPT by Created by another plugin
- How to query custom post then display sections by meta value
- Custom meta box includes
- Creating entries with image attachements within posts and managing them in a list
- Custom Post Type to Upload Images
- Allow authors to create article image
- Post AND page parameter for WP function
- Add text to metabox input text field from Thickbox
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- CPT Metabox with email notification
- Adding a custom “Add Custom Field” button to Custom Meta boxes
- add a “list” into add meta box : problem
- Move title “meta box” in post mode