You are here

function context_delete_context in Context 6

Same name and namespace in other branches
  1. 6.2 context.module \context_delete_context()

Deletes an existing context.

Parameters

$context: The context object to be deleted. The $context->cid property is necessary for this operation.

Return value

Returns true on success, false on failure.

1 call to context_delete_context()
context_ui_confirm_submit in context_ui/context_ui.admin.inc
Submit handler for the context_ui_confirm form.

File

./context.module, line 261

Code

function context_delete_context($context) {
  if ($context = context_load_context($context, TRUE)) {
    db_query("DELETE FROM {context} WHERE cid = %d", $context->cid);

    // Invalidate context cache
    cache_clear_all('context', 'cache');
    return true;
  }
  return false;
}