how to hide page post using facebook api

喜你入骨 提交于 2019-12-20 03:13:14

问题


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!


回答1:


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


来源:https://stackoverflow.com/questions/17704409/how-to-hide-page-post-using-facebook-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!