如何使用facebook api隐藏页面帖子

时间:2013-07-17 15:46:42

标签: facebook-graph-api facebook-php-sdk facebook-page

我有这个代码,而且来自这个链接https://developers.facebook.com/docs/reference/api/page/(请参阅'隐藏页面帖子')

我没有任何错误,但我的问题是,此代码无效。页面帖子仍然不是隐藏的

以下是我的代码:

$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(); 

我期待着找到答案。谢谢!

1 个答案:

答案 0 :(得分:4)

您可以在发布后隐藏帖子:

$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"));