Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Last active December 20, 2018 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheshwaghmare/91c5a0addc98f7d057a9901d1f441e53 to your computer and use it in GitHub Desktop.
Save maheshwaghmare/91c5a0addc98f7d057a9901d1f441e53 to your computer and use it in GitHub Desktop.
Fix: WooCommerce - Sorry, this file type is not permitted for security reasons.
<?php
/**
* Fix: WooCommerce - Sorry, this file type is not permitted for security reasons.
*
* @since 1.0.0
*/
if( ! function_exists( 'prefix_woocommerce_csv_product_import_valid_filetypes' ) ) :
function prefix_woocommerce_csv_product_import_valid_filetypes( $defaults ) {
// Override for the PHP version 7.2.
$defaults['csv'] = 'text/plain';
return $defaults;
}
add_filter( 'woocommerce_csv_product_import_valid_filetypes', 'prefix_woocommerce_csv_product_import_valid_filetypes' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment