user3679330
user3679330

Reputation: 139

Adding reference ID to messenger send button links

I have the following code:

<div class="fb-send" data-href="http://www.mywebsite.com/here/?ref=<?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 "http://www.mywebsite.com/here/?ref="

Oh and I also have the Javascript SDK included on the page before the <body> tag

Upvotes: 0

Views: 156

Answers (2)

scottevans93
scottevans93

Reputation: 1079

Try this

<div class="fb-send" data-href="http://www.mywebsite.com/here/?ref=<?=$current_user->ID?>"  data-size="small"></div>

Upvotes: 0

roberto06
roberto06

Reputation: 3864

You just forgot to echo your variable :

<div class="fb-send" data-href="http://www.mywebsite.com/here/?ref=<?php echo $current_user->ID; ?>"  data-size="small"></div>

Upvotes: 2

Related Questions