Woocommerce下载链接获取密钥= 0

时间:2019-03-19 12:35:22

标签: php wordpress woocommerce

在这样的客户下载链接中,我不断得到key = 0:

http://localhost:8888/wordpress/?download_file=8267&order=wc_order_0bmZ6JZCyKmyo&uid=a1e54365c93d83137be3d1c0fac78bc1e2620d836eecbedf0048e84c1b7ea055&key=0

处理可下载文件的代码:

$downloadables = array();

foreach ($product_manager_form_data['downloadable_files'] as $downloadable_files) {

    if (!empty($downloadable_files['file'])) {

        $downloadables[] = array(
            'name' => wc_clean($downloadable_files['name']),
            'file' => wp_unslash(trim($downloadable_files['file'])),
            'previous_hash' => md5($downloadable_files['file']),
        );

        error_log( print_r( "Downloadables: {$downloadables}", true ) );
        error_log(print_r(array_values($downloadables), true));


    }
}

如果手动创建了产品,我会得到正确的密钥:

http://localhost:8888/wordpress/?download_file=7922&order=wc_order_8fgjyzdNVlboD&uid=39b4d48acbb2a24171b2369d7a250d55a889e04f8e8274663cfd44628bd1dbad&key=10f54047-739c-4482-9586-a3c7804a2413

可能是什么问题?在哪里可以找到可下载文件的代码生成键?

0 个答案:

没有答案