WhatsApp share clonable by  

Step 1 - Add this code on your before </body> tag

<script>
function decorateWhatsAppLink() {
   var url = "whatsapp://send?text=";
   var text = encodeURIComponent(window.location.href);
   var $whatsApp = $(".whatsapp");
   $whatsApp.attr("href", url + text);
}
decorateWhatsAppLink();
</script>
1
2
3
4
5
6
7
8
9
10
11
!2
13
14
 <script>
    
//Whatsapp Sharing Code
       
function decorateWhatsAppLink() {
         
var url = "whatsapp://send?text=";
         
var text = encodeURIComponent(window.location.href)
       
// Captures the current page URL
         
var $whatsApp = $(".whatsapp");
          
$whatsApp.attr("href", url + text);
          }
         decorateWhatsAppLink();
</script>

Copy to Clipboard

Step 2 - Add .whatsapp class to your target button

whatsapp

Step 3 - Add this two attributes to the same button

Name
whatsapp
Value
https://api.whatsapp.com/send?text=www.google.com
Name
data-action
Value
share/whatsapp/share