HivePress – Duplicate First/Last Name fields on vendor profile & submit flow (want exactly one required set)

What I want
Have exactly one set of First name / Last name for vendors, make it required, and use it for display/profile. No duplicates anywhere.

Where it happens

  • Vendor profile step: /submit-listing/profile/
  • Vendor profile edit (frontend)

Observed

  • If I create custom vendor attributes Vorname (first) and Nachname (last) and mark them required, HivePress also shows its own (optional) First/Last name fields → I get two sets of name fields.
  • If I delete my custom attributes again, sometimes both name fields disappear from the profile step.
  • Toggling “Frontend editing” / “Required” on the custom attributes changes which set appears, but I can’t get to oneclean, required pair without duplication.

What I tried

  • HivePress → Vendors → Attributes: created text attributes for first/last name; tested with/without “Frontend editing”, “Required”, display areas, etc.
  • Tried to rely only on the built-in HP name fields (optional), but then I can’t make them required without code.
  • I’d like to avoid CSS “hiding” as a workaround—want a proper setup.

Questions

  1. What’s the recommended approach: use the built-in First/Last name fields and make them required via a hook, ordefine custom vendor attributes and disable the built-ins?
  2. If built-in is recommended, which hook/filter should I use to make the built-in First/Last name required and ensure they appear on /submit-listing/profile/?
  3. If custom attributes are recommended, how do I prevent the built-in name fields from rendering so I don’t get duplicates?
  4. Is there a supported way to sync the chosen First/Last name to WP user meta / vendor display name?

Environment (short)

  • WordPress 6.x (DE)
  • PHP 8.x
  • HivePress (latest, free) + ListingHive theme
  • Other plugins: WP Fastest Cache, Complianz, WPForms, Spectra, Popup Maker, Loco Translate, etc. (no HP premium add-ons yet)

Thanks a lot for guidance on the one clean, required name setup!

Hi,

Please use this code snippet to make these fields required [How to add custom code snippets - HivePress Help Center]:

add_filter(
	'hivepress/v1/forms/user_update',
	function( $form ) {
		$form['fields']['first_name']['required'] = true;
		$form['fields']['last_name']['required'] = true;

		return $form;
	},
	1000
);

For display options, please navigate to HivePress > Settings > Users. If you set the Display Name option to, for example, Full Name, the vendor profile will also display the full name, since vendor names are linked to user names. Please note that this will only work after you change this setting and re-save the profile form for existing users, or for any newly created vendors.

Hope this helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.