LucasFerreira LucasFerreira - 3 months ago 15x
PHP Question

How to auto share a post on facebook timeline?

I have a website that uses the Group Buying Site plugin ( It uses facebook app to login and register.

When I add a new item to the cart the user is redirected to

and the function
add_item($product_id, ...)
is called. I want to know if there is a way that when I enter this page I automatically share a post on facebook timeline.



Assuming you have the access token, I suggest you try this:

$result = $facebook->api(
    array('access_token' => $access_token, 'message' => 'Your Post here')