You are here

function fb_instant_articles_api_rules_remove_article in Facebook Instant Articles 7

Same name and namespace in other branches
  1. 7.2 modules/fb_instant_articles_api_rules/fb_instant_articles_api_rules.module \fb_instant_articles_api_rules_remove_article()

Implementation of a Facebook instant article remove.

Parameters

object $node:

2 calls to fb_instant_articles_api_rules_remove_article()
facebook_instant_articles_api_remove_action in modules/fb_instant_articles_api_rules/fb_instant_articles_api_rules.module
Implementation of a Facebook instant article node delete action.
fb_instant_articles_api_rules_action_remove in modules/fb_instant_articles_api_rules/fb_instant_articles_api_rules.rules.inc
Action: Delete facebook instant article.

File

modules/fb_instant_articles_api_rules/fb_instant_articles_api_rules.module, line 80
Provide Drupal rules to manage facebook instant article using API.

Code

function fb_instant_articles_api_rules_remove_article($node) {
  if (isset($node->nid)) {
    $url = url(drupal_get_path_alias("node/" . $node->nid), array(
      'absolute' => TRUE,
    ));
    $client = \Drupal\fb_instant_articles_api\DrupalClient::get();
    $client
      ->removeArticle($url);
  }
}