0
votes

i want share on wordpress a special text on someones personal timeline if he clicks "share".

f.e i have: "oh god, iam pregnant" exact this text i want post on my or his facebook timeline from the coded website. it should see as i or he typed this (no link to website, or anything, blank text) on facebook. its similiar to copy & paste, but share would be easier.

i found this, but this is static, and i work with wordpress and generate multiple random text for the user with posts.

<script type="text/javascript">
$(document).ready(function(){
$('#share_button').click(function(e){
  e.preventDefault();
  FB.ui(
    {
      method: 'feed',
      name: 'This is the content of the "name" field.',
      link: 'URL which you would like to share ',
      picture: ‘URL of the image which is going to appear as thumbnail     image in share dialogbox’,
      caption: 'Caption like which appear as title of the dialog box',
      description: 'Small description of the post',
      message: ''
    }
  );
}
                        );
}
                 );
</script>

a plugin is great too thank you

1

1 Answers

1
votes

What you want to do is not allowed according to the platform policy:

Don't prefill captions, comments, messages, or the user message parameter of posts with content a person didn’t create, even if the person can edit or remove the content before sharing

Even if it would be allowed, the only way to do this is to authorize a user with the publish_actions permission and use the API to post to the user wall. You would not get publish_actions approved for this, so it´s not possible at all.

Just to make this clear: The message must be 100% user generated.