public
Last active

in the yop_poll_model.php file, make this edit around line 2805, and again around 2850

  • Download Gist
yop_poll_edit.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*** add the "other" entry to answers - rlittle ***/
 
// $answer['other_answer_value'] = $request['yop_poll_other_answer'];
 
global $wpdb;
 
$wpdb->query(
"
INSERT INTO `". $wpdb->yop_poll_answers . "` (`poll_id`, `answer`, `type`, `votes`, `status`) VALUES
('" . $poll_id . "', '" . $request['yop_poll_other_answer'] . "', 'default', 1, 'active')
"
);
 
// if you want the "other" value to return to zero
$wpdb->query(
"
UPDATE $wpdb->yop_poll_answers
SET votes = -1
WHERE poll_id = $poll_id
AND answer = 'Other'
"
);
 
/*** end edit ***/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.