dewi
1
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!
ChrisB
2
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:
- Install the Code Snippets plugin from WordPress.org
- Go to Snippets > Add New
- Paste the code above
- Set it to run everywhere
- 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 