Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active May 19, 2026 12:27
Show Gist options
  • Select an option

  • Save xlplugins/45d153df10b5e6536055514eba417b64 to your computer and use it in GitHub Desktop.

Select an option

Save xlplugins/45d153df10b5e6536055514eba417b64 to your computer and use it in GitHub Desktop.
Tm organic by ThemeMove
add_action( 'woocommerce_login_form_end', function () {
if ( ! class_exists( 'WFACP_Common' ) || WFACP_Common::get_id() < 1 ) {
return;
}
$wfacp_id = absint( WFACP_Common::get_id() );
if ( 'wfacp_checkout' !== get_post_type( $wfacp_id ) ) {
return;
}
if ( function_exists( 'WC' ) && WC()->session ) {
WC()->session->set( 'wfacp_id', $wfacp_id );
}
$redirect = esc_url( get_permalink( $wfacp_id ) );
echo '<input type="hidden" name="redirect" value="' . $redirect . '">';
}, 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment