Post on Facebook user's timeline and Like a page
-
I’ve successfully got the WordPress Social Login plugin to work on my wordpress website but now I need to do certain things with the current logged in user’s Facebook account.
The first thing I need to do is I have a button on my site which when clicked needs to post to a user’s timeline a message “Hello World”.
The second thing I need to do is I have a Like button for my website which likes my facebook page without having to send the user to a new page and gets back whether or not the user liked the page.
Is this at all possible to do with WordPress Social Login after a user is logged in?
Basically is there someway I can get the current logged in user which I can use this user with some kind of API that lets me posts to his timeline and lets the user like a facebook page and get back if the like went through successfully?
I saw this in the documentation, an example on how to post to a facbeook user’s timeline:
https://miled.github.io/wordpress-social-login/developer-api-apis.htmlBut I’m a bit confused on how to use this correctly.
I believe this function is executed when I login (correct me if I’m wrong) but I don’t want that. I want this function to execute when I press a button on my page after I’m logged in, but the thing is I’m not sure what to pass into the function when it comes to:
$user_id
$hybridauth_user_profileI’m guessing $user_id is the user’s wordpress user ID? If so I can get that, but not sure about the other one.
$provider I believe I just use ‘Facebook’, though the weird thing is the function doesn’t even use $user_id or $hybridauth_user_profile ?
- The topic ‘Post on Facebook user's timeline and Like a page’ is closed to new replies.