Exemplo n.º 1
0
 function remove_deleted_questions($current_questions_ids = array())
 {
     if (count($current_questions_ids) == 0) {
         $current_questions_ids[] = 0;
     }
     $questions_for_delete = $GLOBALS['wpdb']->get_col($GLOBALS['wpdb']->prepare(" SELECT ID FROM " . $GLOBALS['wpdb']->yop_poll_questions . " WHERE ID NOT IN ( " . implode(',', $current_questions_ids) . " ) AND poll_id = %d ", $this->id));
     if ($questions_for_delete) {
         foreach ($questions_for_delete as $question_id) {
             $question = new YOP_POLL_Question_Model($question_id);
             $question->delete();
         }
     }
 }