# Custome message text for whatsapp attribute

**URL:** <https://community.hivepress.io/t/custome-message-text-for-whatsapp-attribute/5488>\
**Category:** Social Links\
**Tags:** social-links, code\
**Created:** [April 25, 2023, 5:46am UTC](https://community.hivepress.io/t/custome-message-text-for-whatsapp-attribute/5488 "2023-04-25T05:46:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikesh.p251087](https://community.hivepress.io/user_avatar/community.hivepress.io/nikesh.p251087/32/1561_2.png) [@nikesh.p251087](https://community.hivepress.io/u/nikesh.p251087)\
**Post date:** [April 25, 2023, 5:46am UTC](https://community.hivepress.io/t/custome-message-text-for-whatsapp-attribute/5488/1 "2023-04-25T05:46:02Z")

</div>

i have added whatsapp button on attribute section with this code.

[WhatsApp](https://wa.me/%value%)

its working perfectly fine,  
“but i want to send listiing url along with message chat, what to do?” so Lister know about inquiry purpose.

ok i found this code also

```auto
add_filter(
	'hivepress/v1/models/vendor/fields',
	function( $fields, $vendor ) {
		$queried_object = get_queried_object();
		
		if(is_object($queried_object) && 'hp_listing' === $queried_object->post_type){
			$listing = HivePress\Models\Listing::query()->get_by_id( $queried_object->ID );
			
			if($listing){
				foreach ( $fields as $name => $field ) {
				if ( isset( $field['display_template'] ) && strpos( $field['display_template'], '%listing_url%' ) !== false ) {
					$fields[$name]['display_template'] = str_replace( ['%listing_url%', '%listing_title%'], [get_permalink( $listing->get_id()), $listing->get_title()], $field['display_template']);
				}
			}	
			}
		}
		

		return $fields;
	},
	1000,
	2
);

whats changes i have to do with this code? 

```

or, can i manage some custom text for ex. " I got your number from [example.com](http://example.com) , please contact me.

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [April 26, 2023, 3:59pm UTC](https://community.hivepress.io/t/custome-message-text-for-whatsapp-attribute/5488/3 "2023-04-26T15:59:14Z")

</div>

Please send more details that may help to detect or reproduce this issue (e.g., screenshots, where do you want to show this text).

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [May 26, 2023, 4:00pm UTC](https://community.hivepress.io/t/custome-message-text-for-whatsapp-attribute/5488/4 "2023-05-26T16:00:08Z")

</div>

Closed on May 26, 2023, 4:00pm UTC

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