You are here

function hook_answers_best_answer_set in Answers 7.4

Lets modules know when a best answer is set.

Parameters

object $question: The question for which best answer has been set.

object $answer: The answer which has been marked as the best answer.

object $old_answer: The previous best answer for the question.

2 invocations of hook_answers_best_answer_set()
answers_best_answer_flag in answers_best_answer/answers_best_answer.module
Implements hook_flag().
answers_best_answer_flag_flag in answers_best_answer/answers_best_answer.module
Implements hook_flag_flag().

File

answers_best_answer/answers_best_answer.api.php, line 18
Answers_best_answer hooks.

Code

function hook_answers_best_answer_set($question, $answer, $old_answer = NULL) {
  if ($old_answer) {

    // Old best answer unset.
  }
  else {

    // No old best answer to unset.
  }
}