template_redirect hooks redirect wrong URL
The code adds the functions like this: add_action (‘template_redirect’, array( ‘loginForm’, ‘set_submit_login_func’)); Which tells PHP to do this when template_redirect happens: loginForm::set_submit_login_func(); But we can see set_submit_login_func in the questions code and it is clear that it is not a static function: public function set_submit_login_func(){ What you want is a dynamic callable, e.g. class MyClass … Read more