Skip to content

Instantly share code, notes, and snippets.

@grantalltodavid
Last active June 27, 2022 17:11
Show Gist options
  • Save grantalltodavid/855cc6cc258c6e0af009fabbf5071d0f to your computer and use it in GitHub Desktop.
Save grantalltodavid/855cc6cc258c6e0af009fabbf5071d0f to your computer and use it in GitHub Desktop.
Sliced Invoices: redirect to newly created Invoice immediately upon Quote acceptance
add_action( 'sliced_client_accepted_quote', 'si20220627_custom_quote_acceptance_action', 20, 2 );
function si20220627_custom_quote_acceptance_action( $id, $new_post_id ) {
$invoice_id = $new_post_id ? $new_post_id : $id;
if ( $invoice_id ) {
if ( wp_redirect( get_permalink( $invoice_id ) ) ) {
exit;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment