Example #1
0
 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']);
             }
         }
     }
 }
Example #2
0
 public function delete_category_form_data($term_id)
 {
     Database::delete_row($this->args['table'], 'cat_id', $term_id);
 }
Example #3
0
 public function delete()
 {
     if ($this->id > 0) {
         Database::delete_row($this->getTable(), $this->id);
     }
 }
Example #4
0
 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']);
         }
     }
 }
Example #5
0
 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);
     }
 }