function hook_rate_vote_alter in Rate 7
Same name and namespace in other branches
- 6.2 rate.hooks.inc \hook_rate_vote_alter()
Alter the vote before it is saved.
Parameters
array $vote: array( 'entity_type' => $content_type, 'entity_id' => $content_id, 'value_type' => $widget->value_type, 'value' => $value, 'tag' => $widget->tag, );
array $context: array( 'redirect' => &$redirect, // Path. Alter to redirect the user. 'save' => &$save, // Boolean indicating whether the vote must be saved. 'widget' => $widget, // Widget object, unalterable. );
1 function implements hook_rate_vote_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
1 invocation of hook_rate_vote_alter()
- rate_save_vote in ./
rate.module - Save a vote to the database.
File
- ./
rate.hooks.inc, line 108 - Defines module hooks.
Code
function hook_rate_vote_alter($vote, $context) {
// Redirect users to the feedback page when they click on thumbs down.
if ($context['widget']->name == 'thumbs_up_down' && $vote['value'] == -1) {
$context['redirect'] = 'feedback';
}
}