墙帖中不能包含任意 HTML。如果它看起来像 HTML,Facebook 会删除它。我认为 Facebook 唯一会做的其他更改是将看起来像链接的文本转换为链接(因此,如果您在消息中的某处有 http://www.google.com,Facebook 会自动将其转换为链接)。
不过,Facebook 确实提供了一些基本功能,可以通过 stream.publish 通过传入其他参数来包含图片、标题、描述、链接等基本内容。这是一个包含 Facebook 文档 (http://wiki.developers.facebook.com/index.php/Stream.publish) 中的一些内容的示例:
$message = 'Check out this cute pic.';
$attachment = array(
'name' => 'i\'m bursting with joy',
'href' => 'http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/',
'caption' => '{*actor*} rated the lolcat 5 stars',
'description' => 'a funny looking cat',
'properties' => array('category' => array(
'text' => 'humor',
'href' => 'http://www.icanhascheezburger.com/category/humor'),
'ratings' => '5 stars'),
'media' => array(array('type' => 'image',
'src' => 'http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg',
'href' => 'http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/')),
'latitude' => '41.4', //Let's add some custom metadata in the form of key/value pairs
'longitude' => '2.19');
$action_links = array(
array('text' => 'Recaption this',
'href' => 'http://mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#step2'));
$attachment = json_encode($attachment);
$action_links = json_encode($action_links);
$facebook->api_client->stream_publish($message, $attachment, $action_links);
查看this 以了解有关您可以包含哪些附件的更多信息。