Site logo

Archived topic

gb button with custom field dynamic link to send whatsapp message

8 replies · Started by Michael on April 4, 2022

Viewing posts 1–9 of 9

Hi 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!

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
secondline

but the result always one line sentence
firstline secondline
i put the other website that have send whatsapp message that send message with line breaks

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. :)

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 name

if 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)

Hi there,

GP uses the core get_post_meta function 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 ?

its different.
what i put in the post meta and live website whatsapp button link

OK - so GP uses esc_url for 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%20 becomes %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.

This archived topic is closed to new replies.