Plugin doesn’t work after $wp_query->set_404()
-
global $wp_query; $wp_query->set_404(); echo wp_login_url();The meaning of the above code is that it jumps the site to a 404 page and outputs the login page of the site as a string afterward.
However, after enabling WPS Hide Login plugin and using the above code in the website, wp_login_url() will return the string “#” instead of the correct login address. After disabling the WPS Hide Login plugin wp_login_url() returns the normal login address.
I think this is caused by a bug in the WPS Hide Login plugin and you can reproduce the issue in your project using the three lines of code above.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Plugin doesn’t work after $wp_query->set_404()’ is closed to new replies.