i have added whatsapp button on attribute section with this code.
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
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 , please contact me.