Home › Forums › General Issues › Dynamic whatsapp number with fixed url and appended text › Reply To: Dynamic whatsapp number with fixed url and appended text
I leave the exact code in case someone needs it
// Prepend shortcode
function https_wa_shortcode() {
return 'https://wa.me/549';
}
add_shortcode('https_wa', 'https_wa_shortcode');
// Append shortcode
function hi_wa_shortcode() {
return '?text=Hi! ';
}
add_shortcode('hi_wa', 'hi_wa_shortcode');
// Post title shortcode
function post_title_shortcode(){
return get_the_title();
}
add_shortcode('post_title','post_title_shortcode');
// Append shortcode
function text_wa_shortcode() {
return ', here is the last part of the text.';
}
add_shortcode('text_wa', 'text_wa_shortcode');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.