如何在子主题中添加自定义插件文件?

时间:2019-05-07 08:33:59

标签: php wordpress woocommerce

我在/wp-content/plugins/woocommerce/includes/class-wc-download-handler.php中做了一些自定义,我想将其添加到我的子主题中。但是在我添加到mytheme-child / woocommerce / includes / class-wc-download-handler.php后,没有任何变化。我可以知道如何添加文件吗?

    // Track the download in logs and change remaining/counts.
    $current_user_id = get_current_user_id();
    $ip_address      = WC_Geolocation::get_ip_address();
    if ( ! $download_range['is_range_request'] ) {
        $download->track_download( $current_user_id > 0 ? $current_user_id : null, ! empty( $ip_address ) ? $ip_address : null );
    }

    if (isset($_SERVER["HTTP_REFERER"])) {
        header("Location: " . $_SERVER["HTTP_REFERER"]);
    }

    //self::download( $file_path, $download->get_product_id() );

如何将其添加到子主题?

0 个答案:

没有答案
相关问题