public function save_admin_menu() { $data = array(); $p = static::$table['prefix'] . '_'; if (!empty($_POST)) { for ($i = 1; $i < count($_POST[$p . 'id']); $i++) { $data['id'] = $_POST[$p . 'id'][$i]; $data['param'] = $_POST[$p . 'param'][$i]; $data['value'] = $_POST[$p . 'value'][$i]; if (!empty($data['param'])) { Database::save_data(static::$table, $data); } else { Database::delete_row(static::$table, 'id', $data['id']); } } } }
public function delete_category_form_data($term_id) { Database::delete_row($this->args['table'], 'cat_id', $term_id); }
public function delete() { if ($this->id > 0) { Database::delete_row($this->getTable(), $this->id); } }
public function delete_popular() { if (isset($_GET) && !empty($_GET['post'])) { if (is_array($_GET['post'])) { foreach ($_GET['post'] as $post_id) { Database::delete_row(static::$table, 'post_id', $post_id); } } elseif (is_string($_GET['post'])) { Database::delete_row(static::$table, 'post_id', $_GET['post']); } } }
public function delete_post_data() { global $post; if (in_array($post->post_type, $this->args['post_type'])) { Database::delete_row($this->args['table'], 'post_id', $post->ID); } }