Hi,
I think everything is in order, but the routing is wrong.
My goal is to refresh the current page when the member logs in so that the member information is added to the page. I tried to redirect to the current page for this.
The first code gave an error on the homepage (redirects to the latest content). So I checked the page with if and made it appropriate.
But it still redirects to the last content on the home page instead of redirecting to the homepage. Both of them give the result I want when I test unconditionally.
if ( ! is_home() ) {
wp_redirect( get_permalink() );
} else {
wp_redirect( home_url() );
}
exit;
Could there be an alternative solution?
[ad_2]