function rules_action_publish_to_facebook_timeline in Facebook Autopost 7
Callback function called when executing the action.
1 string reference to 'rules_action_publish_to_facebook_timeline'
- fb_autopost_entity_rules_action_info in fb_autopost_entity/
fb_autopost_entity.rules.inc - Implements hook_rules_action_info().
File
- fb_autopost_entity/
fb_autopost_entity.rules.inc, line 186 - Rules integration.
Code
function rules_action_publish_to_facebook_timeline(FacebookPublicationEntity $publication, $privacy, $retry) {
try {
$fb = facebook_autopost_entity($publication->type);
$facebook_returned_id = $fb
->setDestination('me')
->setPrivacy($privacy)
->setRetry($retry)
->publishEntity($publication);
return array(
'facebook_publication_id' => $facebook_returned_id['id'],
);
} catch (Exception $e) {
watchdog_exception('fb_autopost', $e);
drupal_set_message($e
->getMessage(), 'error');
}
}