woocommerce_file_download_filename

woocommerce_file_download_filename

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_file_download_filename') is found 2 times:

  • /includes/class-wc-download-handler.php line 229
    		if ( strstr( $filename, '?' ) ) {
    			$filename = current( explode( '?', $filename ) );
    		}
    
    		$filename = apply_filters( 'woocommerce_file_download_filename', $filename, $product_id );
    
    		/**
    		 * Filter download method.
    		 *
    		 * @since 4.5.0
    		 * @param string $method     Download method.
    
  • /src/Admin/API/Reports/Downloads/Controller.php line 93
    		// Make sure the product hasn't been deleted.
    		if ( $_product ) {
    			$file_path                   = $_product->get_file_download_path( $data['download_id'] );
    			$filename                    = basename( $file_path );
    			$response->data['file_name'] = apply_filters( 'woocommerce_file_download_filename', $filename, $product_id );
    			$response->data['file_path'] = $file_path;
    		} else {
    			$response->data['file_name'] = '';
    			$response->data['file_path'] = '';
    		}