I noticed that the 'href' is missing for some reason in the array passed to FB.ui:
FB.ui({"method":"stream.publish","attachment":{"name":"Post title","href":"","description":"the excerpt[...]","media":[{"type":"image","src":"http:\/\/example.com\/files\/2011\/08\/example.jpg","href":""}]},"action_links":[{"text":"Share","href":"http:\/\/www.facebook.com\/share.php?u="}]});
I took a look in your code and saw that you are using wp_get_shortlink to get the permalink. Jumping right into the Codex and then into WP source I found that this function is returning and empty string when no permalink structure is set. And since my sites are using the default "ugly" permalinks it was returning and empty string and messing up the FB publisher.
I don't know why you chose to use this function instead of get_permalink. I tried to filter the permalink inside the plugin but I couldn't manage:
/**
* filter SFC shortlink
*/
add_filter( 'sfc_publish_permalink', 'filter_sfc_shortlink', 10, 2 );
function filter_sfc_shortlink ( $permalink, $id ) {
// if ( $permalink == '' )
$permalink == get_permalink( $id );
return $permalink;
}
So I ended up hacking sfc-publish.php by replacing wp_get_shortlink with get_permalink.
It works for now, but could you please tell me how to accomplish that without hacking the plugin?
Thanks!