• Resolved Etienne

    (@epipo)


    Hi,

    I am using field groups to separate my fields but I have one question:

    – How could I display the field group title like a section title in the registration form?

    Thanks.

    • This topic was modified 6 years ago by Etienne.
    • This topic was modified 6 years ago by Etienne.
    • This topic was modified 6 years ago by Etienne.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Alessandro Tesoro

    (@alessandrotesoro)

    Hi there,

    At the moment there isn’t a way to add the name of the field group within the form because the form doesn’t “know” from which group the field is coming from.

    An alternative way to add a title within that form, would be to modify the registration form template and add the title between line 27 and line 28 highlighted here https://github.com/WPUserManager/wp-user-manager/blob/master/templates/forms/form-registration.php#L28

    You can use the $key variable to detect which field’s is being processed within the loop and accordingly decide where to put your custom html.

    Example:

    If the key of the field is wpum_my_own_field you can use that to display a title before the field’s output.

    <?php foreach ( $data->fields as $key => $field ) : ?>
    
    			<?php if ( $key === 'wpum_my_own_field' ) : ?>
    				<h2>My title goes here</h2>
    			<?php endif; ?>
    
    			<fieldset class="fieldset-<?php echo esc_attr( $key ); ?>">

    If you have any other questions about the custom field’s addon, please get in touch through the address support[at]wpusermanager.com because due to WP.org rules I’m not allowed to provide support for paid products through this forum.

    Thread Starter Etienne

    (@epipo)

    That’s perfect.
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show field group name in registration form’ is closed to new replies.