Created
May 19, 2020 20:46
-
-
Save renventura/5120f3cda15eefa26e384bd901cfe8c4 to your computer and use it in GitHub Desktop.
Filters the Custom Redirects for WooCommerce redirect URL (requires http://wc-redirects.com/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_custom_redirects_redirect_url', 'wcr_filter_redirect' ); | |
/** | |
* Filters the custom redirect URL. | |
* Requires Custom Redirects for WooCommerce. | |
* @link http://wc-redirects.com/ | |
* | |
* @param string $redirect Redirect URL | |
* @param string $type Redirect type (add-to-cart or after-purchase) | |
* @param int $product_id ID of product | |
* | |
* @return string | |
*/ | |
function wcr_filter_redirect( $redirect, $type, $product_id ) { | |
// Logic here | |
return $redirect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment