Make “input” field required

  • Author
  • adminplantzeebo

    In the settings option under my account, i want to make the entries under it “required” instead of optional and also redirect a new user who has registered to the settings page/form.


    If you mean the first name, last name and description fields you can make them required by overriding their settings via HivePress API “hivepress/v1/forms/user_update” filter, here’s an example:

    	function( $form ) {
    		if ( isset( $form['fields']['first_name'] ) ) {
    			$form['fields']['first_name']['required'] = true;
    		return $form;

    But there’s no way to force users to set these details, they can still register.


    Do i need to make these cahnges under includes/models/class-user.php:100 file ?


    Please don’t edit the plugin files directly, any changes will be erased on update. You can try using this plugin to manage custom PHP snippets or create a child theme and put it in functions.php file.


    Hi, I have used code snippets plugin to make the above code snippet to work , it works perfectly. However is their some changes i can make to the php files of Hivepress to direct a newly registered user directly to the Settings option under My account. ?


    If the above is not possible, how can i add additional fields to the register form ?
    I just need to add the name as well as the contact number fields
    Thank you.


    Please check this topic for setting a custom redirect (there’s a code snippet) Adding custom fields to the registration form requires more customizations, because they should be also saved somehow, not just added so there’s no simple snippet for this.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.


Sign In

Don't have an account? Register

Forgot password?


Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.