我在/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() );
如何将其添加到子主题?