I’m having a little trouble following the context, but it looks like all you have to do is make use of the filters that are provided in the code you’re looking at.
$url = apply_filters( 'wyz_after_register_redirect', $url, $user );
This hook gives you the chance to modify the redirect url before the redirect is performed. You can take advantage of this to send the users where you want them to go.
add_filter( 'wyz_after_register_redirect', 'my_after_register_redirect', 99, 2 );
function my_after_register_redirect( $url, $user ) {
return home_url( $_SERVER['REQUEST_URI'] );
}
You can register your hook by using add_filter
for your own function, my_after_register_redirect
. This will fire the above code when the apply_filters
for wyz_after_register_redirect
is called. The returned string will be used in place of the $url
value.
NOTE: Keep in mind, the Request URI may not be the url you want users to be redirected to. You may have to work around this in another way.