twig = $twig; $this->request = $request; $this->storage = $storage; } public function register_hook() { $interim_login = $this->request->request( 'interim-login' ); if ( empty( $interim_login ) ) { add_action( 'login_footer', [ $this, 'add_footer' ] ); } } public function add_footer() { $user_storage = $this->storage->get_user_storage(); $options_storage = $this->storage->get_options(); $params[ 'login_configuration' ] = false; if ( $user_storage->is_wp_user_set() && ( ! $user_storage->is_totp_enabled() || ! $user_storage->is_totp_configured() ) && $options_storage->has_obligatory_role( $user_storage->get_roles() ) ) { $params[ 'login_configuration' ] = true; } echo $this->twig->render_view( 'login_footer.html.twig', $params ); } }