How Add phone numder field to registration form and verfiy with OTP

Sorry, there’s no simple code snippet or guidance for this because this requires a custom implementation. If you’re familiar with customizations, please try the following suggestions:

  1. Use a custom function for the hivepress/v1/models/user/login action, to log the user out (and block the default login this way) and perform any initial actions related to OTP (e.g. sending an SMS).

  2. Use a custom function for the hivepress/v1/forms/user_login filter, to set a redirect URL for the login form, this way when the login form is submitted you can redirect it to a custom OTP page.

  3. On the custom OTP page, use some form to accept the OTP received by the user (sent on the user login action) and verify it, then log the user in via the preferred way (e.g. third-party plugin or a custom function).

Hope this helps.