user3679330 user3679330 - 1 year ago 84
PHP Question

Adding reference ID to messenger send button links

I have the following code:

<div class="fb-send" data-href="<?php $current_user->ID; ?>" data-size="small"></div>

I am trying to append the current user iD to the link and have that link shared via messenger, however when the messenger share button is clicked it only shares ""

any help would be much appreciated!

Thanks in advance

Oh and I also have the Javascript SDK included on the page before the

Answer Source

You just forgot to echo your variable :

<div class="fb-send" data-href="<?php echo $current_user->ID; ?>"  data-size="small"></div>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download