Question

I have this code and It's from this link https://developers.facebook.com/docs/reference/api/page/ (Please see 'Hiding a Page Post')

I don't have any error but my problem is, this code is not working. the page post is still not hidind

Below is my code:

$fanpage_credit = array(
        'access_token' => $page_token,
        'is_hidden' => true
    );

$fanpage_post_url = '/'.$post_id;
$postResult = $facebook->api($fanpage_post_url, 'post', $fanpage_credit ); 



echo 'HIDE SUCCESS '.time(); 

I look forward for answers. thanks!

Was it helpful?

Solution

You can hide the post after you have posted it:

$fanpage_credit = array(
    'access_token' => $page_token,
    'is_hidden' => true
);

$fanpage_post_url = '/'.$post_id;
$postResult = $facebook->api($fanpage_post_url, 'post', $fanpage_credit ); 

if (isset($postResult["id"]))
    $facebook->api("/$postResult[id]", 'post', array("timeline_visibility"=>"hidden")); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top