facebookfacebook-graph-apifacebook-php-sdkfacebook-page

To update the cover in the face appears on the wall changed the picture, can I hide or delete this post with api?


to update the cover in the face appears on the wall changed the picture, can i hide or delete this post with api ?.

      $json_object = $facebook->api($fanpage."/?  fields=cover&access_token=".$fanpage_token, 'get');
      echo $page_settings_url.'<pre>';
      print_r ($json_object);



      $json_object = $facebook->api($fanpage.'/'.$json_object['cover']['cover_id'],'delete');
      echo 'borrado'.$json_object;*/
      //echo $json_object['stdClass']['cover'];
      //$response = file_get_contents($page_settings_url);
      //$resp_obj = json_decode($response,true);

Solution

  • If my interpretation of your question is correct, you want to upload a page cover photo without a story appearing on the page's timeline?

    This is covered in the Page API documentation - see the Setting a Cover Photo section

    You can also add a no_feed_story parameter to the upload to suppress the news feed story.

    So the code for uploading the cover photo would become:

    $json_object = $facebook->api($fanpage."/? fields=cover&access_token=".$fanpage_token, 'POST', array('no_feed_story' => 1));