Join our new community forum for support & discussion

Join Now

Home Support Themes RentalHive Snippets for ADD DETAILS Page

Snippets for ADD DETAILS Page

  • Author
    Posts
  • Mishoo

    Hello @yehven and @ihor,

    went through the forum on the search for the following SNIPPETS:

    On the ADD DETAILS Page:

    • Change Title and Description for LOCATION
    • Change Title Description for EXTRAS
    • Change Title and Description for DESCRIPTION
    • Change Title and Description for BOOKING NOTE

    Hope you can help me out, since the SNIPPETS You share on the forum are truly a huge help plus am learning this.

    Thanks in advance!
    Mish

    yevhen developer

    We recommend to change text with Loco Translate plugin. Here is a tutorial https://help.hivepress.io/article/12-how-to-translate-an-extension

    But if you want to do it with code then there is PHP snippet

    add_filter(
    	'hivepress/v1/forms/listing_submit',
    	function( $form ) {
    		
    		// Change field Title label.
    		if(isset($form['fields']['title'])){
    			$form['fields']['title']['label'] = 'Your custom text';
    		}
    		
    		// Change field Description label.
    		if(isset($form['fields']['description'])){
    			$form['fields']['description']['label'] = 'Your custom text';
    		}
    		
    		return $form;
    	},
    	1000
    );
    Mishoo

    @yevhen thanks! Will follow through!

    Note: Translate Press interferes with the translations. Turning off the plugin showed all loco translate translations.

    One last question: Can you provide a snippet to add a description to the
    LOCATION, EXTRAS and DESCRIPTION attribute.

    Thank you!

    yevhen developer

    Please try this PHP snippet

    add_filter(
    	'hivepress/v1/forms/listing_submit',
    	function( $form ) {
    		
    		// Change field Location description.
    		if(isset($form['fields']['location'])){
    			$form['fields']['location']['description'] = 'Your custom text';
    		}
    		
    		// Change field Description description.
    		if(isset($form['fields']['description'])){
    			$form['fields']['description']['description'] = 'Your custom text';
    		}
    		
    		// Change field Price extras description.
    		if(isset($form['fields']['price_extras'])){
    			$form['fields']['price_extras']['description'] = 'Your custom text';
    		}
    		
    		return $form;
    	},
    	1000
    );
    Mishoo

    Very helpful! Thank you! @yevhen

Viewing 5 posts - 1 through 5 (of 5 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.