woocommerce_file_download_filename

woocommerce_file_download_filename

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_file_download_filename') is found 2 times:

  • /includes/class-wc-download-handler.php line 238
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    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 70
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    // Make sure the product hasn't been deleted.
    if ( $_product ) {
        $file_path                   = $_product->get_file_download_path( $report['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'] = '';
    }