- This topic has 8 replies, 4 voices, and was last updated 3 years, 12 months ago by
David.
-
AuthorPosts
-
April 4, 2022 at 9:33 am #2177762
Michael
Hi im trying to create whatsap link in custom field text with line break.
but the message in whatsapp is always a single line, the syntax is:
https://api.whatsapp.com/send?phone=<xxx-xxx-xxx>&text=firstline%20secondlinethe output is :
firstline secondlinewhat im trying to achive
firstline
secondlineany solution? thank you
April 4, 2022 at 10:16 am #2177786Ying
StaffCustomer SupportHi Michael,
Do you mean you added the text like this? And the <br>tag is missing?
<p>Chat on WhatsApp with <br><span class="">xxx-xxx-xxx</span></p>Let me know!
April 4, 2022 at 11:08 pm #2178244Michael
no, i will put my weblink in the private info.
try whatsapp button that will open whatsap chat message in mobile
i want the message with line breaks
firstline
secondlinebut the result always one line sentence
firstline secondline
i put the other website that have send whatsapp message that send message with line breaksApril 4, 2022 at 11:24 pm #2178249Michael
this is the syntax that i put in the post meta->custom fields
https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline
and in the header , gb button code is dynamic options->dynamic link->meta field name
and somehow the result copy link from the button in live website is
https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline (no linebreak)April 5, 2022 at 12:08 am #2178282Fernando Customer Support
Hi Michael,
It would be best to reach out the the support of Whatsapp with regards to this as this is out of our scope.
Here is an article with regards to our scope of support: https://generatepress.com/what-support-includes/
Thank you for understanding. 🙂
April 5, 2022 at 12:59 am #2178333Michael
Hi fernando, thank you for your response.
but i believe the problem is in the header , gb button code is dynamic options->dynamic link->meta field nameif i set the link directly in the gb button, this code
https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline
return corectly in the live website (2 lines)but if i put the link in the post meta->custom fields
above code is somehow transform into
https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline (no linebreak)April 5, 2022 at 1:29 am #2178346David
StaffCustomer SupportHi there,
GP uses the core
get_post_metafunction to retrieve the value of the post meta ( custom ) field. It doesn’t interfere with the content of that field. So if the output link is different to the custom field value then something else is interfering with that.If you inspect the link using the browser developers tools ( Right Click > Inspect the link ) – is the Post Meta link different to the Static Link ?
April 5, 2022 at 2:24 am #2178404Michael
its different.
what i put in the post meta and live website whatsapp button linkApril 5, 2022 at 4:15 am #2178487David
StaffCustomer SupportOK – so GP uses
esc_urlfor any links it outputs this is primarily for security and it is that WP function that is stripping part of the URL ie. this%20%0AWA2%20becomes%20WA2%20.
There is something that WP doesn’t like about that string. You may want to find an alternative URL encoding to output what you need. -
AuthorPosts
- You must be logged in to reply to this topic.