WordPress at Your Fingertips
function is not described

WC_Product_CSV_Importer_Controller::is_file_valid_csv() public WC 1.0

Check whether a file is a valid CSV file.

{} It's a method of the class: WC_Product_CSV_Importer_Controller{}

Return

true|false.

Usage

$result = WC_Product_CSV_Importer_Controller::is_file_valid_csv( $file, $check_path );
$file(string) (required)
File path.
$check_path(true|false)
Whether to also check the file is located in a valid location (Default: true).
Default: true

Code of WC_Product_CSV_Importer_Controller::is_file_valid_csv() WC 5.9.0

public static function is_file_valid_csv( $file, $check_path = true ) {
	if ( $check_path && apply_filters( 'woocommerce_product_csv_importer_check_import_file_path', true ) && false !== stripos( $file, '://' ) ) {
		return false;
	}

	$valid_filetypes = self::get_valid_csv_filetypes();
	$filetype        = wp_check_filetype( $file, $valid_filetypes );
	if ( in_array( $filetype['type'], $valid_filetypes, true ) ) {
		return true;
	}

	return false;
}