How do I rename the default fields on the 'Add Details' page?

Hi,

I can edit the titles for the attributes I have added myself, but how do I change the standard titles set by HivePress on this page: https://ohmfromohm.co.uk/submit-listing/details/

For example, to change ‘TITLE’ to ‘LISTING TITLE’, or ‘LOCATION’ to ‘POSTCODE?

Thanks!

Hi @dewi,

Here’s a PHP snippet to change the field labels for both the listing edit and listing submit forms:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		// Change Title field label
		if ( isset( $form['fields']['title'] ) ) {
			$form['fields']['title']['label'] = 'Listing Title';
		}
		
		// Change Location field label
		if ( isset( $form['fields']['location'] ) ) {
			$form['fields']['location']['label'] = 'Postcode';
		}
		
		return $form;
	},
	1000
);

add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
		// Change Title field label
		if ( isset( $form['fields']['title'] ) ) {
			$form['fields']['title']['label'] = 'Listing Title';
		}
		
		// Change Location field label
		if ( isset( $form['fields']['location'] ) ) {
			$form['fields']['location']['label'] = 'Postcode';
		}
		
		return $form;
	},
	1000
);

How to add this snippet:

  1. Install the Code Snippets plugin from WordPress.org
  2. Go to Snippets > Add New
  3. Paste the code above
  4. Set it to run everywhere
  5. Save and activate the snippet

This will change “Title” to “Listing Title” and “Location” to “Postcode” on both the listing submission and listing edit forms.

You can also copy and re-use the examples provided to change the wording of other default attributes.

I hope this helps!

Cheers,
Chris :victory_hand: