Created
May 26, 2016 22:54
-
-
Save webaware/e2817c2fcdd8d3cb4ee498d75d27ebb9 to your computer and use it in GitHub Desktop.
Redirect an Order Form for WooCommerce form to a custom URL on submit. https://orderform-woo.webaware.net.au/reference-manual/filter-hooks/
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 | |
/* | |
Plugin Name: Order Form for WooCommerce Redirect | |
Plugin URI: https://gist.github.com/webaware/e2817c2fcdd8d3cb4ee498d75d27ebb9 | |
Description: redirect order form to specific page when submitted | |
Author: WebAware | |
Author URI: http://webaware.com.au/ | |
@link https://orderform-woo.webaware.net.au/reference-manual/filter-hooks/#orderform_woocommerce_form_redirect | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; | |
} | |
/** | |
* redirect order form to specific page when submitted | |
* @param string $redirect_url where the form would normally redirect to | |
* @param string $submitredirect the value of the `submitredirect` attribute | |
* @return string | |
*/ | |
add_filter('orderform_woocommerce_form_redirect', function($redirect_url, $submitredirect) { | |
return home_url('/your-page-slug/'); | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment