I have two lines of code.
<div class="fb-share-button" data-href="http://mysocialrewards.com.au/hellofresh/?ref=<?php print $current_user->ID; ?>" data-layout="button" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fmysocialrewards.com.au%2Fhellofresh%2F%3Fref%3D<?php print $current_user->ID; ?>">Share</a></div>
This one is on the my-account.php file and allows user to share the link to their facebook with the php executed
<div class="fb-share-button" data-href="http://mysocialrewards.com.au/hellofresh/?ref=[insert_php]print $current_user->ID;[/insert_php] " data-layout="button" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.mysocialrewards.com.au%2Fhellofresh%2%3Fref%3D[insert_php]print $current_user->ID;[/insert_php] &src=sdkpreparse">Share</a></div>
This one is in a page where I have to use [insert_php] to execute php code, it is essentially the same but when I click to share this url it doesnt send the end of the url that is the current user ID.
I think it has something to do with the [insert_php] tag in the wordpress page as it works fine in the first example.
I was hoping someone could help me get this working in wordpress pages as it is an important part of the website.
Edit: I also have the facebook javascript added to the of the website