I think the proper filter would be mime_types found here.
function wpse294198_mime_types( $mimes ) {
$mimes['xls|xlsx'] = 'application/vnd.ms-excel';
return $mimes;
}
add_filter( 'mime_types', 'wpse294198_mime_types' );
You can use command line tool file
(linux|macOS) to see the mime type, e.g. file --mime-type -b somefile.xls
Related Posts:
- Upload Multiple Files With media_handle_upload
- How to get the image EXIF date/time and use it for the WP post date/time
- delete uploaded file
- How to save Uploaded image in custom option panel?
- Max file size not updating
- Allowing SVG uploads in media uploader without plug-in
- Custom image size in Media Dropdown
- Images uploaded using media uploader are appearing upside down
- Can I hide certain upload folders in media library [duplicate]
- WordPress upload_mimes not working for front-end uploads of 3D files
- Disable auto-resizing of uploaded images, but only for certain filename
- When sale price is 0.00 show only regular price
- Can’t generate thumbnail images
- How to stop media_sideload_image from running when deleting a post?
- Possible to hook into Media Library preview File column and use a custom image?
- Function that prevents users from uploading photos more photos
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- How to add HTML into error message
- Serving cache from multiple domain names
- restrict uploaded image size and fixed image display size
- Function image_send_to_editor returns emty title tag
- Zip all (original) images from media gallery
- Figure inlined width trigger distorted layout
- wp_upload_bits – define (sub)folder / (sub)directory before filename?
- Rename file after title , one small problem
- When the WP_EDITOR button is pressed, the user is prompted to select a photo from their device
- How to overwrite image if it already exists – WordPress, Gravity form
- Convert Image to Webp on upload without plugin
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- Check if post is being published for the first time, or is an already published post being updated
- How to get woocommerce inventory status [closed]
- Is there a hook or function I can use to display all theme files being used on a current page?
- Implementing DNS Prefetching with WordPress
- How can I remove the title “leave a reply” in the comment box in twentyeleven?
- Why do I get Fatal error: Call to undefined function get_most_recent_post_of_user()?
- Login using the password from protected pages
- Remove tag on my RSS Feed
- Automated mark posts as featured every day
- Enqueuing External Javascript functions.php
- Child Theme Not Overriding Parent Theme
- Function to wrap the_content in a div
- How to run a function once on every post in database?
- Date/time limitation of posts where function must be executed
- How do I get a child theme to load scripts from the parent theme?
- How to make applyFilters function return false via functions.php
- How to call custom function from functions.php in site-wide template files?
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- example of build_query function?
- Avoid loading css from parent theme
- retrieve current user meta data (custom fields included)
- Calling a function from anywhere, used in different places
- How do I redirect all 404 error url to Subcategory url
- async javascript and css for wordpress
- How add various functions within 1 conditional?
- Create cron job for update translations automatically
- Login Redirect if Logged in from Specific Page
- get_next_posts_link not working without parameter max_num_pages
- create filter in functions.php
- Logout Shortcode URL
- Override the function twentytwelve_scripts_styles in a child theme
- Custom taxonomy widget in admin area
- What is the Difference in bones_comments() and comments.php
- Redirect to another page using contact form 7? [closed]
- Custom Sidebar only on single post
- Can I have an additional functions.php file in WordPress?
- Shotcode argument issues
- Split Media Queries in different files!
- functions.php and conditional tags
- Tracking the number of shortcodes for a list?
- Need help with customalert that it would read on a normal page, but not in WordPress
- Child theme function.php causes fatal error
- How to print the current post depth as update notification?
- How to safely edit functions.php
- Linking Javascript in functions.php file
- Enqueueing scripts selectively & activation where needed
- Changing the text of Upload/Insert on Posts and Pages Screen
- Using One Function To Create Two Different Shortcodes
- remove edit link only for published post and pending post
- Change Page Title
- Put images in the media from url functions
- Paragraph spaces in email template function
- Including Font Awesome in a Custom Theme
- Insert Modal on user first login
- Trying to load JavaScript only on pages within a PODS category/ custom post type
- How would I correctly implement a new if statement in a child functions file?
- Correct way of Enqueue self hosted fonts in sass project
- function syntax is off,
- Language Switch Function
- How to debug function file causing white screen
- Change category checkbox into radio button [duplicate]
- Load CSS conditional on custom field is present
- Modify sub_menu function to show pages below a specifically set page
- Add custom class to all URLs on entire site
- Show the online status of the current post’s author
- Functions.php in child theme that loads CSS file breaks website
- restrict access to specific urls on a specific period of time
- Change conditional tag in wordpress without editing the core files
- clickable title of 2 post on mainpage USING functions.php
- Setcookie not setting cookies anywhere except admin
- WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories