• I’m using a pre-built registration form for new users to sign up to a website. I want to be able to add two fields to the form so that users can input their first name and last name to the form, and that will then display in the user dashboard in the back-end of the website.

    Heres the php code as it stands: I’ve added the fields to the form, but I’m getting an issue where even though first name and surname are being submitted, they aren’t appearing in the user’s account in the dashboard.

    Thanks,
    G

    public static function init_fields() {
    self::$fields = apply_filters( ‘register_form_fields’, array(
    ‘creds’ => array(
    ‘nicename’ => array(
    ‘label’ => __( ‘Username’, ‘jobify’ ),
    ‘type’ => ‘text’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 1
    ),
    ‘first_name’ => array(
    ‘label’ => __( ‘First Name’, ‘jobify’ ),
    ‘type’ => ‘text’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 2
    ),
    ‘last_name’ => array(
    ‘label’ => __( ‘Surname’, ‘jobify’ ),
    ‘type’ => ‘text’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 3
    ),
    ’email’ => array(
    ‘label’ => __( ‘Email Address’, ‘jobify’ ),
    ‘type’ => ‘text’,
    ‘required’ => true,
    ‘placeholder’ => __( ’[email protected]’, ‘jobify’ ),
    ‘priority’ => 4
    ),
    ‘password’ => array(
    ‘label’ => __( ‘Password’, ‘jobify’ ),
    ‘type’ => ‘password’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 5
    )
    ),
    ‘info’ => array(
    ‘role’ => array(
    ‘label’ => __( ‘About You’, ‘jobify’ ),
    ‘type’ => ‘select’,
    ‘required’ => true,
    ‘priority’ => 6,
    ‘options’ => array(
    ‘none’ => __( ‘—Select—’, ‘jobify’ ),
    ’employer’ => __( ‘I'm an employer looking to hire’, ‘jobify’ ),
    ‘candidate’ => __( ‘I'm a paralegal applying for jobs’, ‘jobify’ )
    )
    )
    )
    ) );
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • Looks like you are using a plugin jobify? to create the form? Are you adding that code to it’s core files or in your theme e.g. functions.php?

    Have you read their documentation or have a link to it?

    Thread Starter brandnucreative

    (@brandnucreative)

    Hi Latro,
    Thanks for your response, Im using a theme called jobify, and a plugin is integrated called WP job manager. The code above is from a php file located within the theme folder, the registration form can be viewed at

    https://www.theparalegalportal.uk/jobseeker-sign-up/
    The theme documentation is quite limited, and doesn’t explain how to add any extra fields to the pre-built registration form. The form originally includes fields for username, password, email and role, but not first and last name, which I would like to add.

    Many Thanks,
    Gareth

    Moderator bcworkz

    (@bcworkz)

    There is little we can do to help folks using commercial themes because we cannot access the source code. Modifying theme forest theme templates are particularly difficult because their themes are typically installed as child themes, preventing site owners from safely installing custom templates.

    You really only have two possibilities. If the theme offers filters or actions you can hook to add or change content, that is your best option.

    The other option is to use javascript to alter the form after it is loaded by the browser. This is a very weak option to be used as a last resort.

    Hi Gareth, I am facing the same problem here.
    Could you share your solution with the community in case you found it? ??

    Cheers
    Luca

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add custom field to wordpress register form’ is closed to new replies.