You are here

function facebook_autopost in Facebook Autopost 7

Factory function.

Add here the classes that need to override methods from FBAutopost.

Parameters

string $type: The type of Facebook publication to return. Use NULL to not specify a type.

6 calls to facebook_autopost()
fb_autopost_authorization_retry in ./fb_autopost.module
Helper function to publish on user timeline after failing the first time.
fb_autopost_entity_available_facebook_pages in fb_autopost_entity/fb_autopost_entity.rules.inc
Returns the available options for the $page paramenter.
fb_autopost_facebook_login in ./fb_autopost.module
Helper function to redirect after facebook login.
fb_autopost_facebook_logout in ./fb_autopost.module
Helper function to redirect after facebook logout.
fb_autopost_global_settings in ./fb_autopost.admin.inc
FAPI system admin form.

... See full list

File

./fb_autopost.module, line 264
Module implementation file

Code

function facebook_autopost($type = NULL) {
  switch ($type) {
    case 'photo':
      $fb = new FBAutopostPhoto();
      break;
    case 'event':
      $fb = new FBAutopostEvent();
      break;
    case 'post':
      $fb = new FBAutopostPost();
      break;
    default:
      $fb = new FBAutopost();
      break;
  }
  if ($type) {
    $fb
      ->setType($type);
  }

  // Allow other modules to alter $fb.Useful for altering the underlying
  // BaseFacebook object for things like adding proxy support to curl options
  drupal_alter('facebook_autopost_fb', $fb);
  return $fb;
}