public function get_col($query = null, $x = 0)
{
if ($query) {
$this->query($query);
}
$new_array = [];
// Extract the column values
for ($i = 0, $j = count($this->last_result); $i < $j; $i++) {
$new_array[$i] = $this->get_var(null, $x, $i);
}
return $new_array;
}
/** * Deletes all plugin terms. * * @return void */ private function delete_terms() { $query = "\nSELECT term_id\nFROM {$this->wpdb->term_taxonomy}\nWHERE taxonomy = %s\nLIMIT 500"; $query = $this->wpdb->prepare($query, $this->taxonomy); while ($term_ids = $this->wpdb->get_col($query)) { foreach ($term_ids as $term_id) { wp_delete_term($term_id, $this->taxonomy); } } }