You are here

function simplenews_subscription_delete in Simplenews 7

Same name and namespace in other branches
  1. 7.2 simplenews.module \simplenews_subscription_delete()

Delete subscriptions.

Parameters

$conditions: An associative array of conditions matching the records to be delete. Example: array('tid' => 5, 'snid' => 12) Delete the subscription of subscriber 12 to newsletter tid 5.

Related topics

4 calls to simplenews_subscription_delete()
simplenews_category_delete in ./simplenews.module
Delete newsletter category from the database.
simplenews_rules_action_subscription_delete in simplenews_rules/simplenews_rules.rules.inc
Action Implementation: Delete an email address from a specific Simplenews newsletter
simplenews_subscriber_delete in ./simplenews.module
Delete subscriber and corresponding subscriptions from the database.
simplenews_subscription_delete_multiple in includes/simplenews.admin.inc
Callback function to delete subscriptions.

File

./simplenews.module, line 1514
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_subscription_delete($conditions = array()) {
  $query = db_delete('simplenews_subscription');
  foreach ($conditions as $key => $condition) {
    $query
      ->condition($key, $condition);
  }
  $query
    ->execute();
}